Hello,
We apologize for the issue you are facing with conflicting canonical tags on your paginated custom post type archive. This can indeed lead to confusion for search engines and affect your site’s indexing.
To address this issue, it’s important to ensure that the canonical tags for paginated pages are set correctly. By default, Rank Math should handle canonical tags appropriately, but in cases where custom post types and pagination are involved, additional adjustments may be necessary.
Here are a few steps you can take to troubleshoot and potentially resolve the issue:
-
Check Rank Math Settings: Ensure that the canonical URL settings for your custom post type are configured correctly in Rank Math. You can do this by navigating to Rank Math > Titles & Meta > Custom Post Types and reviewing the settings for your portfolio post type.
-
Custom Canonical Tags: If you want to set a specific canonical URL for your paginated pages, you can use the rank_math/frontend/canonical
filter to customize the canonical URL programmatically. Here’s an example of how you might implement this in your theme’s functions.php
file:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
if ( is_post_type_archive( 'portfolio' ) && is_paged() ) {
$canonical = get_permalink( get_option( 'portfolio_page_id' ) ); // Adjust as necessary
}
return $canonical;
});
Make sure to replace portfolio_page_id
with the actual ID of your portfolio page.
-
Review Pagination Settings: Ensure that your pagination settings are correctly configured in WordPress. Sometimes, issues can arise from how pagination is set up in your theme or custom post type registration.
-
Clear Cache: If you are using any caching plugins, clear the cache after making changes to ensure that the new settings take effect.
-
Check for Conflicts: Since you’ve already confirmed there are no conflicting plugins or themes, it might be worth temporarily switching to a default theme (like Twenty Twenty-One) to see if the issue persists. This can help identify if the problem is theme-related.
If these steps do not resolve the issue, we recommend replying to this ticket with your site URL so that a human agent from our support team can take a closer look at your specific setup and provide more tailored assistance.
Thank you for raising this concern, and we hope to help you resolve it soon!
Sources:
How to Fix Indexing Issues in Google Search Console » Rank Math
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.