A filter on pre_get_posts
should do it.
function hide_author_wpse_138491($qry) {
$exc = 123;
if (
!is_admin()
&& !is_singular()
) {
$qry->set('author','-'.$exc);
}
}
add_action('pre_get_posts','hide_author_wpse_138491');
This should exclude results from the author with ID = 123 on all front end pages except for “single” pages, which sound like what you are aiming for– ie, to “completely hide all posts by author X from the search, category, taxonomy pages etc.”
Related Posts:
- Is it possible to disable certain user roles from creating tags?
- How to set up sub-categories for author pages?
- How to make a relationship between books and authors?
- Root level category, tag, author and archive pages to work
- How to have a static category/author page?
- Automatically assign posts by author to a specific category
- Search by word, category, tag, author
- How to group the loop posts in a particular by author?
- How to control template resolution if both Author and Category filter in place?
- How to show author name only if the post is in a specific category?
- Display posts separated by Category in Author’s page
- Restrict author to create subcategory in a selected category
- Add /category/ to an author archive page
- How to conditionally hide author name on Single.php if category is “news”, otherwise if category is something else display author name?
- Author Page – List of categories plus number of posts in that category
- Post by category+author not working!
- Display Related Posts by “Category” “by Author”
- what file I need to create to work date archive links?
- Assign author to category and not only posts
- Assignt automatically two categories by author
- How to fetch common posts from two feeds?
- Assign a category to all articles
- How do you add Author and date Published on Category Pages?
- how to Specifies an author / editor to edit one category only?
- Archives and category of authors
- How can i hide the authors box from a specific set of categories and post types?
- How to display posts by author in a separate page, other than author.php?
- Limit authors on specific catogories
- Hook when category is added to post
- get_categories for custom post type with a specific custom taxonomy attached
- What’s the URL for a category archive?
- Exclude categories from Loop, queries, widgets, post navigation
- how to use a different domain/subdomain for authors/catagories on single site?
- WordPress 1 domain multiple blogs
- Category count inside the link
- Is there a way to have duplicate category slugs?
- Multiple level category drop-down
- One WordPress Install, Two Categories. Each Category Gets a Domain
- Name of last category level for a post
- How to add style to category link?
- WordPress Ordering Problem. How to fix ordering 1-10-100 issue?
- how to show posts of category random by session
- Remove “Parent” Selection When Adding/Editing Categories?
- Filtering search results
- WooCommerce change category url and product base
- How can we get Catergory / Term Creator
- Seperate WordPress catagories into sepeat list on seperate pages
- Redirect category to first available child post
- Show post only if match all categories
- How to get product count with respect to categories in WooComerce
- Display WordPress Parent Categories Only?
- Additional featured post on first page
- Assign automatically and manually modify category
- Displaying a full post instead of a slug per category?
- How do I toggle pagination on/off in search results and category listings via a link?
- get_categories() returns “Uncategorised”
- How to show WordPress parent and child category using a different template?
- How can I get categories IDs if multiple categories requested via URI?
- List categories with custom code
- WordPress for Podcast Network
- Categories widget show empty?
- Exclude a category from a query that includes its parent category
- Count the posts number for every category
- Trying to get variables in hacked category dropdown
- Change of category structure will cause two kinds of URLs for one post
- Portfolio Filter Buttons Wont Work
- Woocommerce filter function not updating
- Get Meta Keys of Custom Categories
- Change slug of Standard wp Post category
- Hide a category of posts from main blog, and only show in category view
- ACF no print data [closed]
- Get the name of category in query
- Archive filtering
- How can I check which archive has referred the single? [closed]
- Split multiple categories into two columns
- WooCommerce shared categories
- Add custom categories and subcategories and posts as custom pages
- pagination 404 error, same slug home and categories
- How can I order all subcategories alphabetical independent of the parent categories?
- Add Catgory (assign) to Post Programmatically (without editing)
- Linking to the most recent post in my podcast category
- How to select a parent category and show the children to choose in another select?
- Subcategories in Category Page
- How can I display categories on different pages
- How to add excerpt and read more button to category archive page
- Icon images across multiple categories
- custom browse by
- Use different file includes for single.php
- How to get related category/categories in WordPress archive page
- Adding a button to a product if it’s in a category, then linking to that category
- Pages with posts filtered by category
- Categories Going to different Blog Pages?
- Display only the latest post
- Change next_post and previous_link to navigate throught parent categories only
- Template files not working for archives and categories
- Multiple Parent Category URLs
- What defines a post as portfolio page content?
- How to add location as category?
- Taxonomy term RestApi data 10 rows limitions
- Restricted category in Woocommerce [closed]