How to Disable Category Archives Pages in WordPress

WordPress is a great CMS for organizing your blog. WordPress has its own unique features, and they’re (mostly) very useful. Category archives pages is a great feature by WordPress. But some people likes to stick on WordPress tag instead of category. If you are one of them, then you better disable category archives pages. 

Let’s check how easy it’s to disable WordPress category archives page. I’m going to show you 2 different ways to disable WordPress category archive pages. 

First method is for advance WordPress user, who knows how to edit function.php file. Second step is for all both advance and general user’s. 

Open your active theme’s function.php file via any code or text editor. Then copy and paste the following code.

				
					// Remove category archives
add_action('template_redirect', 'jltwp_adminify_remove_archives_category');
function jltwp_adminify_remove_archives_category()
{
    if (is_category()){
        $target = get_option('siteurl');
        $status = '301';
        wp_redirect($target, 301);
        die();
    }
}

				
			

If you have properly placed the code inside your function.php file, then you should check your existing category archive page. Now, let’s see how you can do this from your dashboard.

To continue the second step, make sure you have installed WP Adminify plugin. Otherwise, you won’t be able to see the disable category archive page option.

Click on the WP Adminify option first. Then navigate to Tweaks > Post / Archive. You will see “Disable Category Archives” option. Just enable the option and save the plugin settings. 

Disable Category Archives pages in WordPress
Was this article helpful?

© 2021-2024 - Adminify | All rights reserved

WP Adminfy accepted payment methods