Hook 'template_redirect'
action hook and redirect if in category using wp_redirect
add_action('template_redirect', 'no_cat_archives');
function no_cat_archives() {
if ( is_category() ) { wp_redirect( home_url(), 301 ); exit(); }
}
Related Posts:
- WooCommerce: List All Categories
- How can I hide a category from Contributors in the edit/add new post screen?
- Category page doesn’t use category.php, instead it redirects to homepage
- Multiple post categories – single permalink
- Wrap Post count in a span
- How to exclude uncategorized from permalink structure /%category%/%postname%/
- Create product category and keyword search form in woocommerce? [closed]
- How can I create a loop to build slides based on multiple categories using Coda Slider
- Saving two categories from two dropdowns in front end posting form
- How would you create a “weekly” archive?
- Exclude most recent posts from specific category in wp_query()
- Display all posts with same title
- Show children of top level category only
- is_archive() content being shown instead of is_category()
- wp_list_categories to show list of categories and the description
- How to display a description of a given category from a custom taxonomy
- Filtering by Category doesnt paginate correctly on the backend
- Add custom taxonomy under the category title
- Direct link to category?
- How to modify category.php to list posts alphabetically?
- Include template before a loop
- Sorting posts by season
- Include posts from feature category in pre_get_posts
- Create blog page only to see one category
- Looking for the best solution to build this Blog structure? Picture attached?
- How Can I Display Categories Description
- Specified number of categoy posts not showing correctly
- Display Slug instead of Name
- List all the categories with or without post
- Set Current Category to Active in category.php
- Filtering multiple categories via the URL
- How to hide category description in the subpages? [closed]
- WordPress query via checkbox form
- Multiple categories with common subcategories
- Counter in loop in foreach
- How to limit number of attachments
- Show category name and new articles and display page numbers. What function to use
- Add child category to parent on post creation and save
- wp_list_categories in in nav_menu
- WordPress Post # of # filtered by category slug
- wordpress multisite… collect all posts on main blog – exclude category?
- Sub category templates
- How to use an array of categories as a dropdown?
- Automatically redirect a page to a category that share the same slug
- How to put an array in is_category
- How to add custom color fields to the category edit page?
- How to create a custom categories page
- Target a specific category from a custom taxonomy?
- How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?
- Searching for a category returns nothing if category is empty
- Edit tag_id in category pages of dashboard
- wp_list_categories with category description
- Category page returns 404 error
- Query posts by views on category page
- How to get nav to show current_page_parent class when on regular post (not blog), differentiated by category
- How to exclude posts from category posts count
- Custom Page Template Category loop not functioning correctly
- javascripts files not linking to my category slugs?
- Generating a feed of all but one category of posts
- Pretty URLs with Categories and Tags
- Select posts that match multiple category names, must match all categories listed
- How can i display category title over thumbnail?
- Need help with major category and permalink re-organization
- Include home page template in specific category template
- How to add categories using mysql
- How to use category slug with a regular page
- Display all categories but only if they have posts in them that have a specific tag assigned
- How to fix select filter on category
- wp_dropdown_categories() works correctly but the list is not filtered in admin for custom post type. What is the problem?
- Show audio player only in specific post type category
- Check with Jquery if second level checkbox from categories are checked
- display current portfolio categories from a specific parent
- Regarding Tags And Categories
- How to show entries related to main category
- selecting categories that have products with tag/category
- how to get only grandchild category from a child category
- How to get WooCommerce Product Categories and its children’s children?
- How to hook into creating a category?
- Media Library Category Exclude Tree
- When category name and title are the same … WP will select archive.php instead of single.php
- show posts in archive page based on selected catagory
- How to display child-category PAGES on a category page
- How get all media from a posts category by db?
- Cant get unique_array() work on get_the_category() foreach loop
- Get the categorie name of Event Organiser plugin [closed]
- Show One Level Category id
- get_categories returns top-level categories instead of child categories
- Show posts from all categories
- Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/
- Display the category name of a post that is in two different categories
- how to Specifies an author / editor to edit one category only?
- Show one same template for two category
- My Query is getting the wrong data
- Formating content in category.php
- How to use Greek characters/letters in a query?
- WordPress Loop Prob
- Display post content from category name using ajax
- WooCommerce category display in custom page
- How to display the category featured images [closed]
- Echo Category In Loop