PHP SEO Filters for Super Speedy Filters

We have added a number of PHP filters to Super Speedy Filters to let you tailor our text overrides for the browser title (<title>), the page title (<h1>) and the description (html).

For these filters to be active, you need to be on a page where we would apply our own SSF filters. That means you need to check the SEO tab and enable or disable these at various levels. They can either be: Off completely, On for multi-term archives only or On for all shop pages. A multi-term archive page is a page where you have two or more terms selected e.g. a Brand and a Category.

Each of the filters passes through a SuperSpeedyPermalink Meta object called $pm. See the bottom of this doc for a guide to usage.

Archive Browser Title Override

Alter what we set for the <title> tags on your pages.

add_filter('ssf_archive_title', function($title, $pm) {...});

Archive Meta Description Override

Alter the meta description contents.

add_filter(‘ssf_archive_meta_description’, function($meta_description, $pm) {…});

Archive H1 Override

Alter what goes inside the <h1> tags.

add_filter('ssf_archive_h1', function($title, $pm) {...});

Archive Description Override

Alter the text that appears below the <h1> tags, e.g. category or brand description.

add_filter('ssf_archive_description', function($description, $pm) {...});

Archive HTML Override

This filter lets you alter what is contained typically within h1 tags.

add_filter('ssf_archive_html', function($html, $pm) {...});

Each of the filters above passes a $pm object which is a SuperSpeedyPermalink object.

The primary function you want to use for this is:

$active_filters = $pm->getfilters();

The above returns an associative array of taxonomy names => term_ids, for example:

['product_cat'=>1, 'pa_color'=>'25,29']

You can then use whatever logic you wish to check for whatever you need and display anything in these SEO areas.

You should also check out our GUI for SEO Overrides which covers a lot of this functionality, but obviously being able to code against this means the possibilities are limitless.

Be the first to comment and we'll reply right away.

Leave a reply

×
1/1
Super Speedy Plugins
Logo