3

The codex page for register_post_type seems to suggest that it should be possible to disable feed generation for custom post types:

 rewrite
    (boolean or array) (optional) Triggers the handling of rewrites for this post type. 
    To prevent rewrites, set to false.
...

$args array
...
    'feeds' => bool Should a feed permalink structure be built for this post type. 
        Defaults to has_archive value. 

I read that as meaning this:

 register_post_type('People', array('rewrite' => array('feeds' => false)));

would result in my 'People' archive page not having this:

<link rel="alternate" type="application/rss+xml" title="My Site &raquo; People Feed"
    href="http://mysite.com/people/feed/" />

in its head. However, the above is output in the HTML. Have I misunderstood, or done something wrong? I do not want a feed to be generated.

Any help much appreciated.

Toby

2
  • Maybe the feed link is hardcoded in the header template of your current theme.
    – anroesti
    Aug 29, 2014 at 19:52
  • It's not unfortunately, it's coming out of wp_head() Sep 1, 2014 at 8:12

1 Answer 1

0

In case it helps anyone...

I had misunderstood - the feeds argument of 'rewrite' was merely about the formatting of feed URLs (to use rewriting).

What I want is not to have a feed URL output in the <head> of my custom post type pages. The only way I have found to do this, is using

remove_action( 'wp_head', 'feed_links_extra', 3 ); 

although this will suppress the feed in other circumstances (categories etc), not just for my custom post type. If anyone knows how to do what I want I'd love to hear from you!

Toby

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.