探索,發現,愛好、學習,記錄,分享。
學海無涯,天涯若比鄰,三人行,必有我師。

删除Rank Math WordPress SEO插件中显示的:This XML Sitemap is generated by Rank Math WordPress SEO Plugin

在模板functions.php文件放入任意一段代码:

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

要隐藏屏幕截图中指向的句子,可以使用以下代码:

$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 );

如果您想完全隐藏蓝色标题部分,请尝试以下代码:

$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 );

 

版權聲明:本文采用知識共享 署名4.0國際許可協議 [BY-NC-SA] 進行授權
轉載事宜:如需轉載需徵得應允,轉載必須注明來源於本站的信息。
文章名称:《删除Rank Math WordPress SEO插件中显示的:This XML Sitemap is generated by Rank Math WordPress SEO Plugin》
文章链接:https://www.thefreesky.com/blog/26951.html
本站資源僅供個人學習交流,請於下載後24小時內刪除,不允許用於商業用途,否則法律問題自行承擔。

評論 抢沙发