What are SEO add-ons
The SEO add-ons can allow you to change your website metas and permalinks when it comes to using website search with WPSOLR. WPSOLR can be used with different SEO plugins like Yoast SEO or All in One SEO.
Create an index
Go to “Connect your indexes” to create a new index. I am going to connect to a search server.
Fill in the information below with the information from your search server.
Activate the SEO extension
Go to “Activate extensions” and click on the correct extension in the sidebar, either “Yoast SEO” or “All in One SEO”. The configuration of the two extensions are identical so you will be able to follow along.
Click on the first checkbox to activate the extension. If you click on the second one it will speed up sitemaps generation. Sitemaps are generated by Yoast SEO but it can have problems generating them when there is a large amount of data. WPSOLR can help Yoast SEO generate sitemaps faster even when there is a huge quantity of content. Cartochrome uses WPSOLR to speed up MyListing sitemap generation for more than one million listings.
You can also choose how many entries sitemaps will have by filling in the section below the second checkbox. The test mode prevents anyone except logged in users from seeing SEO metas. If test mode is removed bots will also be able to crawl search permalinks.
If you don’t want bots crawling your search pages and search results click on these two checkboxes.
You should see this if you inspect the front part of the website
You can replace the meta title and description. “meta” will be replaced by your search.
Here I searched for “Tshirt” as an example. We can see the title in the website tab has changed.
If we inspect the website, we can see that meta has indeed been replaced by website search.
if you want to change the search page permalink in the url, fill in the the permalink you would like to use in this section. In our example above, the search url will start with /my-search/.
before you would see this url when searching.
but after choosing a search page permalink you should see something like this.
You will have to select the “Use permalinks” option otherwise it won’t work. Then click on “Redirect search”.
Click on “Generate search facets permalinks” if you want to generate permalinks for facets. However each facet needs to be configured individually as described in the “Configure WPSOLR” section below. You can also check the “Redirect facets to permalinks home” if you want to display results on permalink homepage instead of search page.
This is what we would see before.
This is what we our url looks like now.
Don’t forget to also activate the “Theme” extension. If you forget, you will not be able to choose certain option when configuring your facets. For example the range slider will be unavailable.
The Range slider in the filter section we will see later is only available if the Theme extension is activated.
If you’re using WooCommerce, don’t forget to activate the “WooCommerce” extension.
Click on “Define your search” then click on the “Search” checkbox and select your search engine index in the first dropdown menu.
Click on “Data” in the sidebar.
Select the content you want to index. In my case, i chose products. Then choose the taxonomies you want to index.
Choose the fields you want to use as filters.
Click on “Filter” in the sidebar.
Select the filters you want to use.
the slider can’t be used with the Yoast extension, so if you want the price filter to appear in the permalink choose something like “Regular Range with radioboxes”. Select “Generate a permalink for this facet”. Here I chose to display price then the starting price and the ending price.
If you want to change the order in which the filters will appear, click on “Set a position in the permalink url”. Then drag and drop the filters.
Do the same thing for the stock filter as well.
You don’t need to change the stock status, but you can if you want a different name for each item label.
Click on the “Override each item label” button.
Fill in the name you want to display and choose a permalink you would like to use.
Before we ended up with this
Now we would see this.
If you want to see this facet in the permalink, click on “Generate a permalink for this facet”. The permalinks can be translated with a multilingual plugin like WPML. Here is the WPML documentation.
Click on the “Generate a permalink for this facet”.
Index your content
Click on “Send your data” .
Click on “Index selected post types in index ‘elastic1′”.
Add the WPSOLR Facet widget
Click on Customize on the front part of your website then on widgets and sidebar. You will then have to add a new widget and choose WPSOLR Facets.
Test the website search
As you can see search is working well.
The filters are working well.
The permalinks are also working. We can see here that facets are separated by a + sign in the permalink. Here we have selected to facets.
I searched for something without selecting any filters.
We end up with this url.
Here I tried searching for something and then selecting a filter.
We end up with this url.
If you click on a product and then click on a category, you will see that the search filters also applies.
However the permalinks will not apply.
As you can see, the noindex, nofollow options still apply. If you want to see this tutorial in detail, you can watch this video: