Home > Software engineering >  How to block unused URLs in Wordpress Theme
How to block unused URLs in Wordpress Theme

Time:02-02

I have made a very simple website (2 Pages) using Wordpress Waterlava theme. My website contains many URLs, for which I haven't created a page, but still they open up in the web browser.

e.g.

<my website URL>/author/user/

<my website URL>/category/uncategorized/

To block such URLs, I tried to comment template getter function names in array named $tag_templates defined inside template-loader.php. But this solution did not work. Any idea how I can solve this issue?

CodePudding user response:

The uncategorized is a default category that could not be deleted. If you do not have any posts inside this category, the URL will not display anywhere in your website, because empty categories are hidden by default (99% in all themes settings). Now, if you want to stop these URLs from search engines, you may add them to robots.txt file via a reg exp Disallow. Last but not least, the author URLs

<my website URL>/author/user/

does appear, when you display the author's name inside your blog posts. You may see sometimes:

written by **author**

This author name is a link, that users of your website could click and see all the posts of the specific author.

  • Related