SEO - API

Disable images in XML Sitemap

By default, All in One SEO Pack outputs images in the XML Sitemap to comply with search engines such as Google that want images submitted to them for indexing in Google Images. This feature was added in version 2.4 of

Add Attribute to Google Analytics

You can use the aioseop_ga_attributes filter hook to add custom attributes to your Google Analytics script. For instance: add_filter( ‘aioseop_ga_attributes’, ‘add_seo_analytics_attribute’ ); function add_seo_analytics_attribute( $attributes ){ // This adds the Cloudflare attribute “data-cfasync” and sets it to false. $attributes .= ‘data-cfasync=”false”‘; return

How to remove rel=’next’ and rel=’prev’ from paginated content

All in One SEO Pack adds rel=’prev’ and rel=’next’ to paginated content and archives, similar to how WordPress core adds it to single posts to link to adjacent posts. You can change these URLs, or remove them completely using the

Disable Meta Description on AMP pages

By default, All in One SEO Pack outputs the meta description on AMP pages. You can remove this meta description using the filter below: add_filter( ‘aioseop_amp_description’, ‘__return_false’ ); Filter added in All in One SEO Pack v2.3.12.1 and All in One SEO Pack Pro

Disable Open Graph meta on AMP pages

By default, All in One SEO Pack outputs Open Graph meta on AMP pages. You can remove this meta using the filter below: add_filter( ‘aioseop_enable_amp_social_meta’, ‘__return_false’ ); Filter added in All in One SEO Pack v2.3.12.1 and All in One SEO Pack Pro

Noindex Password Protected Posts

In some cases, you may want to noindex password protected posts and pages in All in One SEO Pack. You can use our handy filter aiosp_noindex_password_posts. Simply return true and all password protected posts will be noindex, follow.   Example Usage

Disable removal of Twitter meta from official Twitter plugin

By default, we remove the Twitter meta output by the official Twitter plugin when the Social Meta Module in All in One SEO Pack is active. This is to ensure there’s no duplicate Twitter meta being output to the site.

Password Protected Posts in XML Sitemaps

In order to remove password protected posts from your XML Sitemap in All in One SEO Pack, use the following API filter hook. add_filter(‘aioseop_sitemap_include_password_posts’, ‘__return_false’);

Remove Canonical URL on a Page

If you need to disable All in One SEO Pack’s canonical URL functionality on a particular page, you can use the aioseop_canonical_url filter hook. This filter hook accepts one parameter, which is the original URL. Use some sort of logic

Filter XML Sitemap Data

Filtering the XML Sitemap Data for All in One SEO Pack can be done with the aiosp_sitemap_data hook. This hook can accept four arguments; $sitemap_data, $type, $page, and $options. $sitemap_data is an array of all URLs in your sitemap and accompanying data. $type

[i]
[i]
Skip to toolbar