You can add something like this in your category.php.
if ( ! is_admin() ) {
wp_redirect( home_url() );
exit;
}
This will redirect viewers to website homepage but category pages will be active and accessable to admins only.
Related Posts:
- Can I set a default featured image for a category?
- Could not insert term into the database
- What’s the URL for a category archive?
- Weird behaviour when adding terms/term_taxonomies programmatically
- How can I get category ID by category name?
- Randomise results from a category page?
- Is there a way to have duplicate category slugs?
- Multiple level category drop-down
- Adding Custom User Profile data based upon Categories
- Only show category to certain user levels without plugin
- Order posts by category name
- How can I make wp_list_categories output li with category-slug as class, for its children?
- Get sticky post from category?
- Remove “Parent” Selection When Adding/Editing Categories?
- Categories lose hierarchy order once assigned to post
- Why is this category page limiting the number of posts?
- What’s the difference between “parent” and “category_parent” in a WP_Term object?
- Catchable fatal error: Object of class WP_Term could not be converted to string
- Update taxonomy value of post type in query
- Hide tag and category boxes from the post editor
- how to remove category from database
- Add multiple=”multiple” attribute to categories dropdown
- Allow dot in wordpress permalinks (only for categories)
- How to know if it’s a child taxonomy?
- Collapse subcategories in post edit screen
- Categories: A Greenhorn Question on Strategy (Not Code)
- Using a portfolio_category slug in wordpress URL
- Exclude category from Tag Template
- How to provide value for ‘selected’ on wp_dropdown_categories() for ‘multiple’ options
- Need Category RSS Feed that shows all posts
- How to display post images in category view?
- Nav menu category links not showing
- Making a tourism information website [closed]
- How would I go about adding custom header images per category?
- Exclude a category from the_category in the single post page
- Post publish directly in all categories except one need pending review
- Display category posts before others category custom query [closed]
- Get Prevous/Next Post Specific Category Without Excludes
- Pagination is not working properly in Product Category/Tag pages
- add_rewrite_endpoint returns 404 on archives
- Multiple category archive page
- How to Add Default Content for all Category Pages Before and After Content?
- How to display post type and category links in foreach WordPress code
- Sub Categories Keep Redirecting to Pages With Same Slugs
- Category template to show different categories based on parent
- Customize category page for different custom taxonomies
- Get posts under a category with SQL
- Conditional IF current cat is the smallest/last/end child cat THEN
- Randomly load categories with latest post
- Is it possible to remove from default category widget?
- How to create a custom meta box field in category? [duplicate]
- How to show 1-5 of X Total Results
- Combine “category search order” with “don’t display child posts”
- Finding the category id’s on category intersection pages
- SQL query to return categories and category parents
- How to Remove a Title from All Category and Tags Page?
- category__not_in and id values from variable
- WordPress Show Parent Category Description for Sub-categories
- If x comments in a post move post to category y
- why get_the_post_thumbnail( the_ID()) echos extra post id
- Adding additional content on post depending on post categories
- Root category template?
- How to fetch the highest category in the hierachry for a specific post?
- Woocommerce search form with category select
- How to not display subcategories in Recent Posts widget area?
- Getting the Most Recent Posts from Multiple Categories
- Display category title and three latest post inside the category
- Add Date & Author Meta to Category Archive Page
- A dropdown with checklist
- Custom meta boxes ID prefix showing on first category but not others
- How to store category and tags separatly on wordpress?
- Show Secondary Sidebar on Category pages (archive)
- Get categories of queried posts
- How can I use AJAX with check-box categories?
- wp_delete_term or wp_delete_category?
- Get post content intro text on category.php?
- Conditional category query breaking?
- the category city made as a subdomain
- Unable to browser posts in categories
- 3.1 post formats and specific categories/custom taxonomies
- wp_get_post_categories not work currently on loop.php
- Duplicate new categories across multisite network
- Inline If statement to echo CSS [closed]
- Get category base permalink
- Template category.php with page (no posts)
- WooCommerce showing active product categories on single product page
- how to exclude specific category types (uncategorized) from blog page?
- How to set featured image as background for a specific category?
- Confused about category.php template – not working
- Adding relevant categories to related post
- Code to display category-specific single.php is overriding normal single.php, too
- How to assign image on specified category and not show the image on other categories
- How can I add a Categories page link to a menu? [closed]
- Media Library filter returns undefined function get_current_screen
- Way to show content of a post, but if exceeds character limit revert to excerpt?
- get posts from 2 categories. (2 posts)
- Display all subcategories for a product category in woocommerce
- Converting Categories (with ACF fields) to custom taxonomies
- Why does my WordPress index has a category?
- Images as Categories