Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1191197

    Hi all,

    Is there a way to completely remove all category pages from my Enfold site?

    Thanks!
    D

    #1191361

    Hey sdigit,

    I’m not sure if that would be possible, but if you remove the actual categories then the category pages would disappear as well?

    Best regards,
    Rikard

    #1191364

    Hi Rikard,

    Thanks for the response!

    We use categories for a number of purposes, so we would like to keep them.

    However the category pages are not useful to us, so we’d like to prevent users and search engines from accessing them.

    Is there not some possible modification of code to achieve this?

    Kind regards,
    D

    #1191433

    Hi,
    According to this article this function should work. Try adding this code to the end of your functions.php file in Appearance > Editor:

    /* Remove archives */
    function meks_remove_wp_archives(){
      //If we are on category or tag or date or author archive
      if( is_category() || is_tag() || is_date() || is_author() ) {
        global $wp_query;
        $wp_query->set_404(); //set to 404 not found page
      }
    }

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.