I develop a plugin and therefore I add new RSS feeds. One feed might look like http://local.wordpress.dev/?post_type=custom-post-type&custom-taxonomy=tax-1&feed=custom-feed

This works pretty good. But if pretty permalinks are enabled also this url works which will be redirect to the same feed http://local.wordpress.dev/custom-taxonomy/tax-1/feed/custom-feed.

So far so good. My plugin will list all available feeds for the user. My question what is the best practice to check if pretty permalinks are active and which url version should be displayed?

My idea is to look at $wp_rewrite which permalink_structure is set and decide which version to show. Is there a better way to do it?

1 Answer 1


The Using Permalinks page on WordPress.org tells you how to check for the permalink structure:

if ( get_option('permalink_structure') ) { echo 'permalinks enabled'; }

The result will be an empty string if permalinks are default, otherwise you will get the permalink pattern though you should not have to worry much about the permalink details if you use Core functions to generate your links.

  • 1
    That answer was well hidden in the codex :) Thx for pointing this out.
    – obstschale
    Commented May 19, 2014 at 18:31

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.