您是否尝试过使用remove\\u操作?
示例:
<?php
add_action(\'wp_head\', \'remove_feeds_in_head\', 1);
function remove_feeds_in_head() {
remove_action( \'wp_head\', \'feed_links\', 2 );
remove_action( \'wp_head\', \'feed_links_extra\', 3 );
}
编辑:所以禁用它们并不会删除它们,要完全删除它们,还需要使用remove\\u操作。假设这就是你想要做的。
add_action(\'do_feed\', \'itsme_disable_feed\', 1);
add_action(\'do_feed_rdf\', \'itsme_disable_feed\', 1);
add_action(\'do_feed_rss\', \'itsme_disable_feed\', 1);
add_action(\'do_feed_rss2\', \'itsme_disable_feed\', 1);
add_action(\'do_feed_atom\', \'itsme_disable_feed\', 1);
add_action(\'do_feed_rss2_comments\', \'itsme_disable_feed\', 1);
add_action(\'do_feed_atom_comments\', \'itsme_disable_feed\', 1);
remove_action( \'wp_head\', \'feed_links\', 2 );
remove_action( \'wp_head\', \'feed_links_extra\', 3 );
remove_action(\'wp_head\', \'rsd_link\');
// Add whatever other things you want to remove