AriSEO hooks and developer reference

AriSEO's template function, shortcode, blocks, PHP filters, the editor JavaScript filter, REST and GraphQL output, and where it stores its data.

  • Reference
  • AriSEO
  • 4 min read
  • Updated

AriSEO is plain PHP and plain JavaScript with no build step. While another SEO plugin is active, its front-end output is paused; the filter ariseo_output_enabled can force it on or off.

  • ariseo_breadcrumbs( $echo = true ) prints the trail and also returns the HTML. Pass false to only return it.
  • [ariseo_breadcrumbs] has no attributes. [rank_math_breadcrumb], [wpseo_breadcrumb], [aioseo_breadcrumbs] and [seopress_breadcrumbs] show the same trail when their own plugin is gone.
<?php if ( function_exists( 'ariseo_breadcrumbs' ) ) { ariseo_breadcrumbs(); } ?>

The trail is a nav with the class ariseo-breadcrumbs and an ol with the class ariseo-breadcrumbs__list.

Blocks

BlockTitleAttributes
ariseo/breadcrumbsBreadcrumbs (AriSEO)None; server rendered
ariseo/faqFAQ (AriSEO)questions (array, default []), headingLevel (integer, default 3)
ariseo/tocTable of contents (AriSEO)title (string, default ""), maxLevel (integer, default 3); once per page

PHP filters

FilterParametersWhat it filters
ariseo_context$ctxThe resolved SEO data of the current page: kind, post, term, user, pt, title, desc, canonical, noindex, nofollow, og_title, og_desc, og_type, image, url, paged, max_pages.
ariseo_head_tags$tags, $ctxTags printed in <head>. Each is an attribute array; _tag set to link prints a link element, otherwise a meta element.
ariseo_schema_graph$graph, $ctxThe JSON-LD nodes before they are printed.
ariseo_rich_node$node, $post, $dataThe Event, JobPosting, Product or Recipe node built from the post's fields, before it becomes the page's main entity.
ariseo_image_size$sizeImage size for og:image and schema. Default full.
ariseo_breadcrumb_trail$trail, $ctxTrail items with label and url.
ariseo_breadcrumbs_html$html, $trailThe breadcrumb HTML.
ariseo_sitemap_entries$urls, $name, $pageEntries of one sitemap page: loc, lastmod, optional images.
ariseo_sitemap_index_entries$entriesIndex entries: loc, lastmod.
ariseo_sitemap_exclude_ids$idsPost IDs left out of the sitemap.
ariseo_sitemap_cache$cacheWhether to cache sitemaps (12 hours). Default true.
ariseo_sitemap_external_image$allow, $urlWhether to list an image on another domain, such as a CDN. Default false.
ariseo_llms_txt$outThe llms.txt Markdown.
ariseo_content_html$html, $postHTML counted as a page's content in the site audit (post content plus ACF text fields).
ariseo_post_types, ariseo_taxonomies$types / $taxesPost type and taxonomy objects AriSEO manages.
ariseo_conflicts$foundActive SEO plugins that pause AriSEO (id => label).
ariseo_output_enabled$enabledForces front-end output on or off.
ariseo_404_is_noise$noise, $pathWhether a 404 path is left out of the log.
ariseo_search_is_spam$spam, $searchWhether a site search is answered with a 404.
ariseo_indexnow_active, ariseo_indexnow_endpoint, ariseo_indexnow_hosts$active / $endpoint / $hostsWhether to ping, the endpoint (default https://api.indexnow.org/indexnow), and the host names that may be sent.
ariseo_headless_head$data, $urlHead data sent to headless front ends.
ariseo_settings_tabs, ariseo_tab_section, ariseo_modules, ariseo_tasks, ariseo_health_checks, ariseo_known_settingSee the sourceFor add-ons: settings tabs, which menu section a tab joins, Features switches, Next steps items, site checks, and settings keys that may be saved. The action ariseo_settings_tab_{tab} renders an added tab.
add_filter( 'ariseo_sitemap_exclude_ids', function ( $ids ) {
	$ids[] = 42;
	return $ids;
} );
add_filter( 'ariseo_head_tags', function ( $tags, $ctx ) {
	if ( 'singular' === $ctx['kind'] ) {
		$tags[] = array(
			'name'    => 'rating',
			'content' => 'general',
		);
	}
	return $tags;
}, 10, 2 );
add_filter( 'ariseo_content_html', function ( $html, $post ) {
	return $html . "\n" . (string) get_post_meta( $post->ID, 'my_builder_text', true );
}, 10, 2 );

Editor JavaScript filter

ariseo.analysis.content (wp.hooks) receives the HTML the content analysis reads, post content plus ACF text, textarea and WYSIWYG fields, and the editor state. Return a string; anything else is ignored.

wp.hooks.addFilter( 'ariseo.analysis.content', 'my-plugin/builder-text', function ( html, state ) {
  var field = document.getElementById( 'my-builder-text' );
  return field ? html + '\n' + field.value : html;
} );

REST API and WPGraphQL

Turn on Send the SEO head to headless front ends under AriSEO→Settings first. Nothing below exists while it is off.

  • GET /wp-json/ariseo/v1/head?url= returns the head for any address on the site: url, status, redirect, title, description, canonical, robots, tags, schema, breadcrumbs and html. It needs no login. It answers 409 while AriSEO is paused and 400 for an address on another site.
  • An ariseo_head field on every post type and taxonomy shown in the REST API, in the view and embed contexts.
  • With WPGraphQL: an ariseo field of type AriSEOHead on ContentNode and TermNode, and ariseoHead(url:) on the root query.

The Abilities API (WordPress 6.9 or later, off by default) registers ariseo/get-post-seo, ariseo/update-post-seo, ariseo/get-term-seo, ariseo/update-term-seo, ariseo/list-missing-seo, ariseo/get-settings and ariseo/update-settings.

Stored data and capabilities

KeyWhereWhat
ariseo_settingsOptionAll settings.
_ariseo_{key}Post meta and term metatitle, desc, focus, canonical, noindex (1 noindex, 2 index, empty = type default), nofollow, og_title, og_desc, og_image_id, schema, bc_title, primary_term, score. Terms use the same keys except schema, primary_term and score. focus, score and primary_term are shown over REST only in the edit context.
_ariseo_richPost metaThe fields for the rich result types, one array per type (Event, JobPosting, Product, Recipe). Only the fields for the post's schema type are printed.
{prefix}ariseo_redirectsDatabase tableRedirects.
{prefix}ariseo_404Database tableThe 404 log.
ariseo_edit_seo, ariseo_bulkCapabilitiesSEO fields, and the bulk editor. Granted by role from Who can use AriSEO; administrators always have both.

Still stuck?

Our helpdesk answers on working days, Norwegian time. Include your WordPress version, PHP version, AriSEO version and the code you are using.

Submit a ticketor email info@arihub.com