SEO Rules

SEO Rules are the set of parameters that specify which pages, among the filtered pages, should be available for indexing by Search Engines. Additionally, they determine the exact values of SEO parameters that should be generated on those pages.

By default, all filtered pages are closed from indexing with the <meta name=”robots” content=”noindex, nofollow”>. When you create SEO Rules, you allow Search Engines to index filtered pages that match them.

Before creating the SEO Rule you have to do the following:
1. Go to Filters -> Settings -> Indexed Filters and select the needed filters to be indexed
2. Go to Filters -> Settings -> Indexing Depth and set the maximum number of filters to be indexed for the needed post type

How to create an SEO Rule?

Go to the Filters -> SEO Rules -> Add SEO Rule

  1. Post Type – specify the needed post type for SEO Rule like products/posts/any CPT
  2. Filters Combination – specify the desired filter combination to be indexed. (Note: Taxonomy filters have their own archive pages. And if you set such a filter as indexed, you won’t be able to add its archive page to the filter combination. And vice versa – if you do not set a filter as indexed, you can add its archive pages to the indexed URL)
  3. SEO Title – specify the SEO title here
  4. Meta Description – specify the meta description
  5. H1 Title – specify the H1 that will be modified on the page
  6. SEO Description – specify the SEO description
  7. Insert variable – variables will be replaced with specific values on the page that match the current SEO Rule. For example, on the page with URL path /color-blue/size-large/ variables {color} and {size} will be replaced with words “blue” and “large”

Make sure you turned off from the Settings -> Reading -> Search engine visibility option to make SEO Rules work

Attention: If you index a filter created from a taxonomy, you cannot add SEO rules to the pages of this specific taxonomy.
Either keep the taxonomy filter unindexed (Filters > Settings > Indexed Filters) or index it and apply SEO rules to other pages. Custom field filters allow SEO rules anywhere.

SEO Troubleshooting

Issues with the SEO H1

By default Filter Everything uses next hooks to modify H1:

add_filter( 'the_title', [ $this, 'seoH1' ], 10, 2 );
add_filter( 'woocommerce_page_title', array( $this, 'seoH1'), -5 );
add_filter( 'get_the_archive_title', array( $this, 'seoH1'), -5 );
add_filter( 'avada_page_title_bar_contents', [$this, 'seoH1'], -5 );
add_filter( 'post_type_archive_title', [$this, 'seoH1'], -5 );
add_filter( 'elementor/utils/get_the_archive_title', [$this, 'seoH1'], -5 );

Some WordPress themes use individual H1 hooks in their template files. You can use the code below to specify your theme H1 hook:

add_action('wp', 'wpc_test');
function wpc_test()
{
    if (class_exists('FilterEverything\Filter\Pro\PluginPro')) {
        $seoFrontend = \FilterEverything\Filter\Container::instance()->getSeoFrontendService();

        add_filter('your_theme_h1_hook', [$seoFrontend, 'seoH1'], -5);
    }
}

Issues with SEO Description

By default SEO Rule description is attached to the next hooks

// On WooCommerce pages
add_action( 'woocommerce_after_shop_loop', [ $seoFrontEnd, 'showSeoDescription' ] ); 
// On the WordPress archive pages
add_action( 'get_the_archive_description', [ $seoFrontEnd, 'showSeoDescription' ] ); 

Some WordPress themes use individual hooks in their template files and often replace default WordPress and WooCommerce hooks. You can use the code below to specify your theme hook:

add_action('wp_head', 'wpc_add_filters_seo_description');
function wpc_add_filters_seo_description(){
    if( class_exists( 'FilterEverything\Filter\Container' ) ){
        $seoFrontEnd = FilterEverything\Filter\Container::instance()->getSeoFrontendService();

        // Specify here your hook where you want to see the SEO description
        $your_new_hook = 'woocommerce_archive_description';

        // Only if you need to hide the default description on category pages
        if( flrt_is_filter_request() ){
            // Remove WooCommerce archive description
            remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
        }

        // Remove the default SEO description from the bottom of the page so it won't be duplicated
        remove_action('woocommerce_after_shop_loop', [ $seoFrontEnd, 'showSeoDescription' ], 5);

        // Add SEO description on your hook
        add_action( $your_new_hook, [ $seoFrontEnd, 'showSeoDescription' ] );
    }
}





The code below is from one of our clients matthijscsnl and was not written by the development team. It serves as an example of how you can add extra custom field data to the SEO Rules.

PLEASE NOTE: USE THIS CODE AT YOUR OWN RISK. IF YOU ARE UNSURE OF WHAT YOU ARE DOING, DO NOT USE IT.

/* -----------------------------------------------------------------------------
Add all the code to your child-theme or a custom plugin. 

This code adds a custom meta box to the Filter Everything Pro SEO rules pages, 
saves it with the same ID as the other fields and displays it on the frontend based on that SEO rule ID.
----------------------------------------------------------------------------- */

// Add the meta box
add_action('add_meta_boxes', 'child_add_seo_rule_extra_meta_box');
function child_add_seo_rule_extra_meta_box() {
    $post_type = defined('FLRT_SEO_RULES_POST_TYPE') ? FLRT_SEO_RULES_POST_TYPE : 'seo_rules';
    add_meta_box(
        'child_seo_rule_extra_meta_box',
        __('Extra SEO Field', 'textdomain'),
        'child_seo_rule_extra_meta_box_callback',
        $post_type,
        'normal',
        'default'
    );
}

// Add WYSIWYG callback for the meta box
function child_seo_rule_extra_meta_box_callback($post) {
    // Get existing value
    $value = get_post_meta($post->ID, 'child_seo_rule_extra_field', true);
    
    // Add nonce for security
    wp_nonce_field('child_seo_rule_extra_nonce', 'child_seo_rule_extra_nonce');
    
    // Configure editor settings
    $editor_settings = array(
        'textarea_name' => 'child_seo_rule_extra_field',
        'media_buttons' => false, // Show media upload button
        'textarea_rows' => 10,
        'teeny'         => false, // Show full editor
        'quicktags'     => true
    );
    
    // Output the editor
    wp_editor(wp_kses_post($value), 'child_seo_rule_extra_field', $editor_settings);
}

// Save the meta box content
add_action('save_post', 'child_save_seo_rule_extra_meta');
function child_save_seo_rule_extra_meta($post_id) {
    // Verify nonce
    if (!isset($_POST['child_seo_rule_extra_nonce']) || 
        !wp_verify_nonce($_POST['child_seo_rule_extra_nonce'], 'child_seo_rule_extra_nonce')) {
        return;
    }
    
    // Check permissions
    if (!current_user_can('edit_post', $post_id)) return;
    
    // Save/update data
    if (isset($_POST['child_seo_rule_extra_field'])) {
        $clean_data = wp_kses_post($_POST['child_seo_rule_extra_field']);
        update_post_meta($post_id, 'child_seo_rule_extra_field', $clean_data);
    }
}

// Display the custom SEO rule field value on frontend (as test in wp_head. Change "wp_head" to any other default or custom hook to really display it for users.)
add_action('wp_head', 'child_output_extra_seo_field', 20);
function child_output_extra_seo_field() {
	if( class_exists( 'FilterEverything\Filter\Pro\PluginPro' ) ){
		$seoFrontend = \FilterEverything\Filter\Container::instance()->getSeoFrontendService();
		$seoRulePostId = $seoFrontend->get( 'seoRulePostId' );

		$value = get_post_meta($seoRulePostId, 'child_seo_rule_extra_field', true);
		if (!$value) {
			return;
		}
		// Output the extra SEO field (adjust the markup as needed).
		echo sprintf('', esc_attr($value)) . "\n";
	}
}