Deleting files category, author, date, etc. in WordPress

  • Spammers will be banned immediately without warning. Read our Signup Policies here.
  • 🎉 We've Hit 1 MILLION VIEWS in April 2025! 🚀

    We're proud to announce that blackhatforums.net has officially crossed 1,000,000 page views in a single month — April 2025! 🤯

    This milestone is a direct result of your hustle, strategies, and contributions. Whether you're dominating SEO, pushing traffic, or just absorbing knowledge — this is your win. 💪

    👉 Read the Celebration Thread Here

    — The blackhatforums.net Team

romeo

Newbie
Messages
28
Likes
1
Points
3
As you know, WordPress default file creates a series of publications , specifically generates files author, category, tags, date, input formats and searches, but the fact that it does not imply default and have to be binding.

But above all, it is possible that visutalización of these files in your WordPress is not necessary.

Say, for instance, you do not use categories, or just use one for all, or only author is yourself, or you do not use labels or even that you do not add anything to have a series of links to files or your nor your visitors use.

So what would have a series of files that do nothing?

Speaking of SEO, as you know the file categories and tags can have their own search engine optimization, and you might not want these files to compete in the future with any particular publication, because in reality the structure of these files They do not offer the full content.

Of course, if this is you do not need to delete the files, only to make adjustments in your SEO plugin for not indexing the files would suffice.

Now if you want to eliminate them completely, if you're determined, you only have to add the following code to the file functions.php active topic:
Code:
/ * Delete files WordPress * /

add_action ( 'template_redirect' , 'aw_remove_wp_archives' );

/ * Deleting files * /

function aw_remove_wp_archives () {

  // If we are on file with the category or tag or date or author

  if (is_category () || is_tag () || IS_DATE () || is_author ()) {

    Global $ WP_Query ;

    $ WP_Query -> set_404 (); // define a 404 page not found

  }

}

In the code files categories, tags, dates and author are removed, but you can customize to your liking.
 

Members online