Fix Rank Math Search Results Page Title

While looking at Google Analytics for one of my niche websites, I discovered that the default setting for Search Results Title in Rank Math contains a bug where the reference to the search term is not applied to the <title> tag correctly.

I’ll give you the information required to fix this issue in this article!

Fix Rank Math search results page title

Rank Math search results page title not showing search term

While looking in Google Analytics, I spotted that my website search results page was recording visits but that the search term wasn’t included in the page title, which in theory, should create unique records per unique search term.

Google Analytics results, you search for

This means that all search pages recorded in Google Analytics contain the same page title with the following pattern:

You searched for - [sitename]Code language: CSS (css)

Whereas you’d probably much prefer to have unique page titles that include the searched term, something like the following pattern:

You searched for [search term] - [sitename]Code language: CSS (css)

Fix Search Results Title in Rank Math

So how do we fix this bug in Rank Math?

First, navigate to Rank Math > Titles & Meta > Miscellaneous Pages, then scroll down to Search Results Title.

Rank Math default Search Results Title

You will see the default value for this field is:

You searched for %searchphrase% %page% %sep% %sitename%

How to fix search result title in Rank Math

To correctly display the user’s search term in the search results page title, which Google Analytics will start to pick up unique search query results page titles, you should replace the above with the following:

You searched for %search_query% %page% %sep% %sitename%

Rank Math correct Search Results Title

So all we’re doing here is effectively replacing the incorrect default variable reference of %searchphrase% with the correct variable reference of %search_query%

Immediately, the example page title will display the text "example search" instead of the previously incorrect value of "%searchphrase%".

Thanks for reading, and I hope this short article helps you to improve your analytics reporting, allowing you to analyse the data better and helping you improve the content offering your visitors are searching for.

Leave a comment