I'm building a website and I was wondering if it is possible to exclude certain permalinks from beings used.

For example: if my website has a demo of a project running on www.example.com/demo/ and a user creates a page called demo, I don't want WordPress to create a permalink like www.example.com/demo/.

Is there a way to exclude these permalinks? So that WordPress will take the next available permalink? Like www.example.com/demo-2/ or something?

1 Answer 1


Interesting question. I found this post and tested, it worked for me:


If you don't want to edit your functions.php file an inelegant solution you can try is to create empty placeholder pages with the permalinks you'd like to reserve. If there is a physical directory on the server with that same name that would take precedence over the rewritten WordPress URL. So for example, if you create a WordPress page with slug "demo" and a physical directory in your web public dir called, "demo" you could use that for your demo site files.

Personally I like to use subdomains for this purpose myself to keep any demo work segregated from production, but that's just an opinion.

  • I prefer subdomains too, but it's for an existing website with some old projects that need to stay there for multiple reasons. But if it's possible with Wordpress, I'll give it a try. Thanks for the answer! Jan 6, 2014 at 8:35
  • I'm glad I could help!
    – nocabt
    Jan 7, 2014 at 15:32
  • Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. See How to reference material written by others and How do I write a good answer? in the Help.
    – Pat J
    Jan 15, 2014 at 3:19

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.