Cannot set a unique canonical url for blog sub-pages

#567508
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Pointing the paginated pages (subpages) to the main page using canonical helps in avoiding duplicate content issues and it is usually this way.

    However, you can try the following filter to force the self-referencing canonical URL of your blog subpages:

    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	global $wp;
    	$current_slug = home_url( $wp->request );
    
    	if ( is_paged()) {
    		$canonical = $current_slug;
    	}
    	return $canonical;
    });

    Here’s how you can add a filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Thank you.

    Anonymous
    Rank Math free

    Thank you for your reply, I used the above filter to force the URL rule change did not take effect, when reviewing the code elements to normalize the URL is still only the https://www.hydoll.de/blog/.

    My request is that the canonical URL for https://www.hydoll.de/blog/page/10 is this original link https://www.hydoll.de/blog/page/10, not the current canonical URL https://www.hydoll. de/blog

    Hello,

    In this case, please update the filter with this one:

    add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
    	global $wp;
    	$current_slug = home_url( $wp->request );
    
    	if ( is_paged() && is_archive()) {
    		$canonical = $current_slug;
    	}
    	return $canonical;
    });

    If the issue still persists, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Thank you.

    Anonymous
    Rank Math free

    We followed your method for the second time, but it still doesn’t work
    This is a feature flaw of your rank math, you should not let the canonical url generated by default by rank math exclude subpages, this is a big loss for webmasters with more than 1000+ pages. This will make SEO’s of large sites give up using rank math.

    Why don’t you learn Yoast, even if it is a subpage, Yoast follows the URL of the subpage, but Yoast allows me to fill in the canonical manually, if I don’t, Yoast will follow the URL of the page itself by default, for professional SEO people Yoast this logic is the right one!

    Anonymous
    Rank Math free

    My company has 30 websites, currently 5 websites have rank math installed, these 5 websites are not indexed by Google because of rank math’s canonical url, which causes all our sub-pages to be indexed by Google, making our SEO business suffer a great loss, I am full of expectation that rank math official staff can solve these problems, then you guys make things more and more complicated. You should learn Yoast, otherwise, the SEO of large websites will give up using rank math!

    Hello,

    Can you please share your WordPress and FTP logins in the sensitive data section so that we can check the issue further for you? You can follow the steps from above to share your logins.

    Looking forward to helping you.

    Thank you.

    Anonymous
    Rank Math free

    [moved to sensitive data section]

    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.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Cannot set a unique canonical url for blog sub-pages’ is closed to new replies.