Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rank Math

    (@rankmath)

    Hello @mickyblu82

    Thank you for contacting the support.

    Please use the following filter to remove the credits:
    https://rankmath.com/kb/filters-hooks-api-developer/#sitemap-credit

    Hope that helps.

    Thread Starter mickyblu82

    (@mickyblu82)

    Thank you for the quick response.

    I just added this to the theme functions.php file

    /**
     * Filter to remove sitemap credit.
     *
     * @param boolean Defaults to false.
     */
    add_filter( 'rank_math/sitemap/remove_credit', '__return_true');

    But it is still showing – Does it need to be added elsewhere?

    • This reply was modified 4 years, 8 months ago by mickyblu82.
    Plugin Author Rank Math

    (@rankmath)

    Hello @mickyblu82

    Can you please try refreshing hard as it’s working fine on our setup?
    https://i.rankmath.com/DMmpAB

    Hope that helps. Thank you.

    • This reply was modified 4 years, 8 months ago by Rank Math. Reason: Incorrect reply
    Thread Starter mickyblu82

    (@mickyblu82)

    Hi

    Thank you that has worked, but I would like to remove the link that says learn about XML sitemaps too shown here https://prnt.sc/r9x9os

    The only links I want on my sitemap are links for my website.

    Kindest Regards

    Mick

    Plugin Author Rank Math

    (@rankmath)

    Hi @mickyblu82

    To hide the sentence pointed on your screenshot, you can use the following code:

    $rm_sitemap_counter = 0;
    add_filter( 'rank_math/sitemap/remove_credit', function() {
    	global $rm_sitemap_counter;
    	$rm_sitemap_counter++;
    	if ( $rm_sitemap_counter == 2 ) {
    		echo '<style type="text/css">#description p { display: none; }</style>';
    	}
    	return false;
    }, 10, 1 );

    If you would like to hide the blue header part completely, try this code instead:

    $rm_sitemap_counter = 0;
    add_filter( 'rank_math/sitemap/remove_credit', function() {
    	global $rm_sitemap_counter;
    	$rm_sitemap_counter++;
    	if ( $rm_sitemap_counter == 2 ) {
    		echo '<style type="text/css">#description { display: none; }</style>';
    	}
    	return true;
    }, 10, 1 );

    Please note that this sentence and the link inside it doesn’t matter at all from a SEO point of view. In fact none of the styling matters, these are added inside the XSL file that complements the XML and makes it more easy to read for humans when the XML is opened in a browser. Search engines will ignore the XSL and only look at the raw XML data.

    Hope that helps.

    • This reply was modified 4 years, 8 months ago by Rank Math.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove Blue header and content from sitemap’ is closed to new replies.