-
Hi How can I make a attribute (or other ) filtered / paginated page have the a canonical of the initial page.
e.g.
https://mytap.com.au/select-a-colour/antique-black/?filters=room%5Bkitchen%5D have a canonical of
https://mytap.com.au/select-a-colour/antique-black/Thanks
-
Hello, I understand your concern about setting up a canonical URL for filtered or paginated pages to point back to the initial page. To achieve this in Rank Math, you can follow these steps:
-
Edit the Filtered/Paginated Page:
- Go to the page you want to set a canonical URL for, like
https://www.yourwebsite.com/tag/product-1/
]`.
- Go to the page you want to set a canonical URL for, like
-
Access Rank Math Meta Box:
- Scroll down to the Rank Math SEO meta box while editing the page.
-
Set Canonical URL:
- Look for the Canonical URL field in the Advanced Tab of the Rank Math meta box.
- Enter the canonical URL you want to point to, in this case,
https://www.yourwebsite.com/tag/product-1/
-
Update the Page:
- Save or update the page to apply the changes.
By setting the canonical URL using Rank Math as described above, you can instruct search engines like Google to consider the initial page as the main source of content for all filtered or paginated versions.
If you encounter any issues or need further assistance, feel free to reach out. Thank you for raising this concern!
Sources:
Advanced Tab in Rank Math SEO’s Meta Box
Bulk Editing Options in the Rank Math SEO Plugin
Alternate Page with Proper Canonical Tag Status in Google Search Console » Rank Math
How to Fix ‘Duplicate, Submitted URL Not Selected as Canonical’ Issue in Google Search Console » Rank MathHi that would be ok but the pagination is created dynamically so there is no page for the pagination
Hello,
Apologies for the inconvenience.
In this case, please add this code to set the canonical to the base URL without the filter:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) { if ( ! empty( $_GET['?filters='])) { $current_url = add_query_arg( $_GET, home_url() ); $canonical = esc_url( $current_url ); } return $canonical; } );
And here’s a guide to adding the code to the website:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Let us know how this goes.
Ok Thanks
Can you tell me what the difference in terms of SEO would be to doing it this way and adding the base canonical or using the interface to Noindex Paginated Single Pages, Noindex Search Pages, Noindex Sub PagesHello,
Setting a canonical URL is generally the preferred approach when you want to keep dynamically generated pages accessible to users but ensure that search engines focus on the original page for ranking purposes.
Noindexing is more suitable when the additional pages do not provide value in search results or when you want to streamline the content that search engines index.
Both strategies are valid but are used in different scenarios depending on your SEO goals and how you want search engines to treat the content on your website.
We hope that helps, and please don’t hesitate to get in touch if you have any other questions.
Thank you.
So if I use the snippet above suggested by Reinalle should I then disable the options Noindex Paginated Single Pages, Noindex Search Pages, Noindex Sub Pages in
DASHBOARD / SEO TITLES & META / MISC PAGES
Hello,
Yes, you should disable those options if you want to set the main page URL as the canonical URL of the paginated pages.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thanks
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on TrustPilot about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.
-
The ticket ‘Canonical Question’ is closed to new replies.