0

I have code to disable feeds and remove feed links from the website. When is it safe to use it as an optimization technique for a WooCommerce store? Are any core WooCommerce features dependent on these feeds? I noticed that there are some plugins for WooCommerce feeds, can they possibly depend on default WordPress feeds?

add_action( 'init', 'taisho_kill_feed_endpoint', 99 );
function taisho_kill_feed_endpoint() {        
    global $wp_rewrite;
    $wp_rewrite->feeds = array();
}

remove_action( 'wp_head', 'feed_links_extra', 3 ); // links to the extra feds such as category feeds
remove_action( 'wp_head', 'feed_links', 2 ); // links to the general feeds: Post and Comment Feed
remove_action( 'wp_head', 'rsd_link' ); // link to the Really Simple Discovery service endpoint, EditURI link
remove_action( 'wp_head', 'wlwmanifest_link' ); // link to the Windows Live Writer manifest file
remove_action( 'wp_head', 'index_rel_link' ); // index link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // links for the posts adjacent to the current post
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0); // non pretty URL shortlink
remove_action( 'wp_head', 'wp_generator' ); // XHTML generator that is generated on the wp_head hook, WP version
  • Feed links are only used "external", they are not needed for your installation to works. But indeed, this hook just don't display them in your source code, they still accessible and working. – Gregory Jun 12 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.