Last active
March 23, 2021 01:06
-
-
Save guydumais/5b03c77ae0d12f9ed52bcff00b0f141b to your computer and use it in GitHub Desktop.
WordPress / Désactiver les flux RSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Supprimer toutes les actions et filtres de flux RSS dans WordPress. | |
* | |
* @author Guy Dumais. | |
* @link https://guydumais.digital/fr/blog/comment-desactiver-les-flux-rss-dans-wordpress/ | |
*/ | |
add_action( 'init', $af = function() { | |
// Supprimer toutes les actions de flux RSS. | |
remove_action( 'do_feed_rdf', 'do_feed_rdf', 10 ); | |
remove_action( 'do_feed_rss', 'do_feed_rss', 10 ); | |
remove_action( 'do_feed_rss2', 'do_feed_rss2', 10 ); | |
remove_action( 'do_feed_atom', 'do_feed_atom', 10 ); | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
// Supprimer tous les filtres de flux RSS. | |
remove_filter( 'the_content_feed', '_oembed_filter_feed_content' ); | |
} ); | |
unset( $af ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment