I want to make a custom feed page* with the slug of 'feed', but when I try to save, Wordpress changes it to 'feed-2'.

Is there a way I can force Wordpress to let me use a slug of feed—or, if it's better practice, to hook my custom feed template* into the default Wordpress RSS feed generator? If the latter, what code do I need to substitute my own feed template for the default?

* The custom feed template I'm using is based on the useful code here: http://digwp.com/2011/08/custom-feeds/

  • Just change the slug name. 'feed' is a reserved word (you should respect that). So get over it. LPT1 is a reserved filename in Windows. I got over it. – EarnestoDev Oct 26 '11 at 8:12

That's because "feed" is a reserved term (actually wp_unique_post_slug will match your page name against the rewrite rules).

You might be able to change this by removing the WP feed on init:

unset($GLOBALS['wp_rewrite']->feeds[array_search('feed', $GLOBALS['wp_rewrite']->feeds)]);

(maybe flush the rewrite rules after)

| improve this answer | |
  • The only thing is I am using regular WP-generated feeds for other sections of the site. This looks like it would prevent those as well. – supertrue Oct 26 '11 at 3:55

Your Answer

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

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