Croco Black Friday 2024 banner element
Copy discount code:
bfcroco2024
Days
Hours
Minutes
Croco Black Friday 2024 banner element
Help Center
How to Set up SEO Rules

How to Set up SEO Rules

From this tutorial, learn how to set up SEO Rules for pages containing filters from the JetSmartFilters plugin for WordPress.

Before you start, check the tutorial requirements:

  • Elementor (Free version), Block editor (Gutenberg), or Bricks

  • JetSmartFilters plugin installed and activated

Let’s assume we have a business conference website. We want to build a page with business conferences and filter them by number of participants, conference type, and conference format. Also, on this page, we want to add a speakers list and filter them by their experience.

Then, we want this page to be indexed with different filter results. With JetSmartFilters, you can adjust SEO rules to add a filter page to the sitemap.

Things to know

The SEO rules functionality works with the filters of the “Checkboxes list,” “Radio,” “Select,” and “VisualFilter types.

Create Filters

If you haven’t added filters to a certain page yet, you should first create them in the WordPress Dashboard > Smart Filters > Add New directory.

“Checkboxes list” filter

Preparation

We created a custom “Conference Type” taxonomy and attached it to the “Conference” Custom Post Type (CPT) beforehand.

Things to know

The CPT functionality is available with the JetEngine plugin. However, it is not required for recreating the described case.

taxonomy attached to the post type

After that, we added some tags to the built taxonomy.

tags added to the taxonomy

Then, we also connected CPT posts with the added conference types. It can be done in the CPT directory; just push the “Quick Edit” button next to each needed item and set its tags in the field named as your taxonomy.

Don’t forget to press the “Update” button to save the item.

cpt item quick edit

Filter creation

The first filter we built is a “Conference Type Filter.” This one has a “Checkboxes list” Filter Type. Its Data Source is set to “Taxonomies,” and the Taxonomy to filter is “Conference Type.”

checkboxes list filter

“Radio” filter

Preparation

For the following filter, we went to a “Conference” CPT editor in the WordPress Dashboard > JetEngine > Post Types directory and opened the Meta Fields section

There, we have built a “Conference Format” field of a “Radio” Type and added its values.

We have also enabled the Quick edit support for this field to edit the conference type right in the CPT items list.

conference format radio meta field with option opened

After saving the changes, we headed to the CPT posts list, clicked the “Quick edit” button next to each post, and attached the needed conference types.

cpt item conference format quick edit

Filter creation

The filter we build has a “Radio” Filter Type and is called “Conference Format Filter.”

It is based on “Custom Fields” (the Data Source field), so we specified the Custom Field Key. This field should be taken from the previously set Name/ID of the meta field.

We also enabled the Get Choices From Field Data toggle and set “JetEngine” as the Field Source Plugin.

radio filter

We also put the same custom field value into the Query Variable field.

radio filter query variable field

“Visual” filter

Preparation

The future “Visual” filter will be based on the “Radio” custom field. So, we repeat the procedure of the “Radio” filter preparation and create a “Number of Participants” meta field of the “Radio” Field type in the CPT editor.

number of participants radio meta field with option opened

Filter creation

In the filter builder, we set the “Number of Participants Filter” name to the filter and set its Filter Type to “Visual.”

As the Data Source, we pick the “Manual Input” option and set the Type of the filter to “Color.” 

Then, we set the “Checkbox” Behaviour and adjust the needed options in the Options List.

Things to know

The Value of each option should repeat the Option Value attached to options in the meta field.

visual filter

Also, we specify the Query Variable by putting the Value of the attached meta box in there.

visual filter query variable field

Additional “Radio” filter

We want to add one more “Radio” filter, but this time it will be used to filter speakers of the event.

Preparation

Beforehand, we created one more CPT, “Speakers.”

Also, we added a meta field of a “Radio” Field type.

speakers post type

We added three field options that later will be attached to “Speakers” posts used for filtering as well.

speaker experience radio field options

After the post type was saved, we went to the built CPT, created a separate post for each speaker, and set their experience with the help of the built “Radio” meta field.

experience set for speaker

Filter creation

We create a “Speaker Experience” filter of a “Radio” Filter Type and set its Data Source to “Custom Fields.”

Then, we complete the Custom Field Key field with an “experience” value, the one put in the Name/ID field of the previously built meta field.

After, we activate the Get Choices From Field Data toggle and select “JetEngine” as the Field Source Plugin.

speaker experience radio filter

Then, we complete the Query Variable field with the same value as in the Custom Field Key field and save the filter.

speaker experience radio filter query variable field

Add Filters to the Page

Now, it’s time to add the built filters to the page. First, go to WordPress Dashboard > Pages > Add New.

Here, we change the name of the page. 

Pay attention to the Link of the page, we will need it later.

Things to know

You can build the page with Gutenberg, Elementor, or Bricks.

We click the “Edit with Elementor” button to build our page with Elementor.

filters page

In Elementor, we add all the first three filters’ widgets built for the “Conference” CPT to the page and specify their Query ID. It should be done to attach filters to a certain provider

For instance, we want to have two Listing Grids on the page, one with conferences and one with speakers, so we need to specify which Listing Grid should be filtered with this exact filter. 

So, we set the “first-listing” value for the added three filters.

conference format radio filter in elementor

We attach the same ID to the provider (Listing Grid) in the CSS ID field.

first listing grid

Then, we add one more section with the filter and provider — one more Listing Grid, with speakers this time.

Here, as well, we set the Query ID for the filter. This time, it is the “second-listing” value.

speaker experience radio filter in elementor

The same ID is put in the CSS ID field of the Listing Grid.

second listing grid

Now, we hit the “Publish/Update” button to save the page.

Adjust SEO Rules

Go to WordPress Dashboard > Smart Filters > Settings and open the SEO Rules Settings tab.

Activate the Use SEO & Sitemap Rules toggle.

Press the “Add Rule” button.

use seo and sitemap rules toggle activated

Paste the Link of the built page to the Page URL field; the “filters-page” in our case.

We set “JetEngine” as Provider and “first-listing” as Query ID. The last value refers to the one attached to the filters and provider of the first section of our page.

Things to know

You can leave the Query ID field empty if you don’t connect filters and providers with the help of IDs.

Hit the “Add Filter” button to attach the built filters to the current rule.

first rule with the add filter button

This way, we add the three filters (an allowed maximum).

first rule

Then, we press the “Add Rule” button to create another rule.

We complete the Page URL with the same “filters-page” value as we want this rule to be applied to the same page as the first one.

Also, we set “JetEngine” as a Provider as the second rule is also applied to the Listing Grid.

As the Query ID, this time, we put the “second-listing” value, the one attached to the filter and provider of the second section of the page.

In this rule, we attach one filter.

Then, we press “Save Rules” and the “copy” button next to the sitemap link.

seo rules set

Open the link in your browser. 

Here, you can see the generated results of the filters attached to the rules. 

First on this list are the filters from the first SEO rule set.

first listing sitemap rules

The generated values from the second rule are available in this file as well.

second listing sitemap rules

Use the Sitemap File

Now, you can use the generated sitemap file. For instance, with the SEO plugins like Rank Math or Yoast.

We will work with Rank Math. Also, we need a plugin to paste the code snippet, so we install and activate Code Snippets.

Things to know

You can also add a code snippet in the “functions.php” file right away.

Go to WordPress Dashboard > Snippets > Add New and paste the following code in the special area:

add_filter('rank_math/sitemap/providers', function( $external_providers ) {
	
	class JSF_Provider implements \RankMath\Sitemap\Providers\Provider {
		
		public function handles_type( $type ) {
			return false;
		}
		
		public function get_index_links( $max_entries ) {
			return [
				[
					'loc'         => 'your_xml_url',
					'lastmod' => '',
				]
			];
		}
		
		public function get_sitemap_links( $type, $max_entries, $current_page ) {
			return [];
		}
	}
	
	$external_providers['jsf_provider'] = new JSF_Provider();

	return $external_providers;

});
Warning

Use your generated sitemap link instead of the “your_xml_url” value.

Save and activate the code snippet.

sitemap snippet

Now, we head to WordPress Dashboard > Rank Math SEO > Sitemap Settings.

Click on the link in the banner at the top of the settings window.

rank math seo sitemap settings

Once clicked, you can see that the needed link with the SEO rules file is added to the sitemap.

xml sitemap page

That’s all; now, you know how to adjust the SEO rules for filters built with JetSmartFilters on your WordPress website.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.