Hello,
We apologize for the issue you are facing with the %categories%
variable in Rank Math. Currently, the %categories%
variable is designed to display only the last child category of a post, which is why you are seeing just "District" instead of the full hierarchy.
To achieve the full category path in your post title, you can use the advanced category variable feature. You can customize the output by using the following format:
%categories(limit=4 & separator = - )%
This will allow you to display up to four categories in your title, separated by a dash. However, please note that this will still not show the full hierarchy if there are more than four levels.
If you need a more comprehensive solution that ensures the full hierarchy is displayed, you might consider using a custom function in your theme’s functions.php
file or a custom plugin. Unfortunately, this requires some coding knowledge.
For users who prefer not to handle coding themselves, we recommend our Rank Math Professional Setup Service. This service can help ensure your plugin setup is fully correct and adheres to the latest SEO standards. You can find more information and sign up for this service at Rank Math Services.
Thank you for raising this concern! If you have any further questions or need assistance, please feel free to reply to this ticket, and a human agent will assist you further.
Sources:
Rank Math ‘Titles and Meta’ Options and Settings
%categories(limit=4 & separator = - )%
Unfortunately, this does not work.
Hello,
We have tested the %categories%
variable, and it shows all the categories associated with the post.
In your setup, you should check/include Egypt, Cairo, and Giza, like the structure below, so the variable will show them in the title


Looking forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.