Headless CMS question – How to link subdomain to real domain for SEO reports

#506584
  • Resolved Brady Kirkpatrick
    Rank Math free

    Hello! We are currently using WordPress as Headless CMS for our main site, thus WordPress is on a subdomain (wp.website.com).

    When running Rank Math reports and internal link reports, we are linking to our main site (website.com) instead of the subdomain, which WordPress is on (wp.website.com), and therefore the Rank Math score and internal link reports are not accurate.

    Is there a way to edit settings in WordPress so that our subdomain shows reports based on website.com instead of wp.website.com?

    I hope I explained this properly 🙂

Viewing 15 replies - 1 through 15 (of 26 total)
  • Also, when we try to Open in New Tab for External domains, it’s causing our ‘website.com’ links to open in New Tab, because everything shows as ‘wp.website.com’ in the WordPress subdomain.

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    To fix the internal link issue, please add the following filter code to your theme’s functions.php file and Reset the links data from Database tools – https://rankmath.com/kb/link-counter/#reset-internal-links-data

    
    add_filter( 'rank_math/links/link_type', function( $type, $link ) {
    	$link_parts = wp_parse_url( $link );
    	if ( isset( $link_parts['host'] ) && 'website.com' === $link_parts['host'] ) {
    		return 'internal';
    	}
    
    	return $type;
    }, 10, 2 );
    

    This should fix the Internal/External link count on your site.

    Also, when we try to Open in New Tab for External domains, it’s causing our ‘website.com’ links to open in New Tab, because everything shows as ‘wp.website.com’ in the WordPress subdomain.

    I couldn’t reproduce this issue on my setup. Can you please add your site’s Admin access in the Sensitive Data section by editing the first post on this ticket?

    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.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Also, to replicate the issue, do the following –

    Add links to blog post that are wp.website.com AND website.com.

    If you change settings in Rank Math to Open External links in New Tab, it opens the website.com links In New Tab. We would like to be categorize website.com links similar to wp.website.com 🙂

    Thank you!!

    Pratik,

    I added that code into the functions.php file and reset the links count. It did NOT solve the issue.

    I added it in the staging website I gave you access to. Could you please confirm it looks correct in there?

    I started a Draft Article to test it out.

    Hello,

    I logged into your site and changed the filter code to following:

    
    add_filter( 'rank_math/links/link_type', function( $type, $link ) {
    	$link_parts = wp_parse_url( $link );
    	if ( isset( $link_parts['host'] ) && ( 'www.gunmade.com' === $link_parts['host'] || 'gunmade.com' === $link_parts['host'] ) ) {
    		return 'internal';
    	}
    
    	return $type;
    }, 10, 2 );
    

    This seemed to have fixed the issue: https://i.rankmath.com/i/O38EyL

    Can you please confirm?

    If you change settings in Rank Math to Open External links in New Tab, it opens the website.com links In New Tab. We would like to be categorize website.com links similar to wp.website.com 🙂

    We cannot check this issue on your staging site as the domain is cloudwaysapps.com. Please add your live site admin access in the Sensitive Data Section

    Looking forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    I added the code into wp.website.com functions.php. It did not seem to fix the issue of Open in New Tab for External domains.

    It’s still opening website.com links in new domain.

    Hello,

    Sorry for not following up quickly and for any inconvenience that might have been caused due to that.

    The login details you shared in the Sensitive Data Section have limited access to your site. I only see the Profile page in the Dashboard. Can you please give us admin access?

    Looking forward to helping you.

    I’m sorry… Try now!

    Hello,

    Thank you for giving us admin access to your website. We should get back to you shortly with an update from our development team.

    We appreciate your time and patience in the meantime.

    Hello,

    Thank you for sharing the admin access. I see the issue on your site and I could also reproduce it on my setup. Please allow us some time to test and release a fix.

    For now, to fix the issue on your site, I have added the following code on line 81 in seo-by-rank-math/vendor/mythemeshop/wordpress-helpers/src/helpers/class-url.php file:

    $domain = str_replace('wp.', '', $domain);

    This seemed to have fixed the issue. Can you please confirm?

    I hope that helps.

    It does work for opening in new tabs, thank you for fixing that.

    It does not report domain.com links as Internal links in the Rank Math report though… Did you find a solution for that part as well?

    Thank you!

    Hello,

    It does not report domain.com links as Internal links in the Rank Math report though… Did you find a solution for that part as well?

    In the post column, I see it is correctly reporting the main domain link as internal. Please check the screenshot I added in the Sensitive Data Section.

    Looking forward to helping you.

    Hey Pratik! I thought I responded to this… I added an image in the sensitive data area…

    It doesn’t report the internal links on the Rank Math score report, inside the article on the toolbar. See attached image for more info in 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 15 replies - 1 through 15 (of 26 total)

The ticket ‘Headless CMS question – How to link subdomain to real domain for SEO reports’ is closed to new replies.