The method is similar, just exclude the author by prefixing the id with a minus sign:
$wp_query_obj->set( 'author', '-1' );
See WP_Query
for a full list of query arguments.
Related Posts:
- Ignore a filter on the media library
- Exclude post ID from wp_query
- How to filter by category in REST API, excluding posts also in other category term?
- Get attached media only
- Query Ignoring ‘exclude’ Parameter?
- Show selected images on top in Media Manager
- WP_Query Excluding pages with Order is 0
- Query: offset post list, unless it’s a specific category
- How to fetch only media that was already attached to a post/page?
- Excluding pages in WP_query using ACF
- Exclude Category filter from Portfolio section
- Avoid repeated post on page 2 when excluding one on page 1
- Redirect to another page using contact form 7? [closed]
- 2 wordpress loops showing 1 post from same post type – how to avoid showing the same post?
- Include posts from some categories while excluding from others
- Exclude current post from an array of posts?
- Exclude recently updated post from custom WP_Query using multiple loops
- How to exclude Sticky from Recent Post?
- specific post is not excluded from the loop
- WP_Query: attachment image in “full” size?
- get all images from the wordpress media library with link to the post they are associated with
- How to upload 3 attachments to current post?
- Loop issues when creating custom query for media uploader
- Paginate wp_query while utilizing post__not_in
- Loop within a loop?
- WP_Comment_Query pagination, delving into the unknown
- Sort posts by category name and title
- Getting all user metadata from user
- How to upload images manually to wordpress?
- How to get posts in different language from WPML Plugin [closed]
- Limit WP_Query to only X results (total, not per page)
- How to disable main query?
- Use post__in and post__not_in together?
- how to retrieve specific product attribute value in an sql query?
- How to user WP_Query to lower the number of queries
- Compile two queries to one set of results?
- how do i combine keyword search and taxonomy in a WP_query $args array Worpresss [closed]
- Only display authors who have posts
- Update Loop with Form
- How to retrieve current page WP_Query arguments?
- How can I get an array of all IDs from the current queried object?
- Query Custom Post Type Order By Taxonomy Field
- How to use filter hook “the_posts” with a function that refers to $this?
- Multiple loops without repeating content
- WP_Query, pre_get_posts and offset
- Sort query by author: 1 author, then others
- add_actions called from functions.php not returning good values
- Multiple Search Terms WP_Query
- Show posts from a custom taxonomy on a page
- How to return a 404 when custom query matches nothing?
- Should wp_query automatic meta and term cache priming be used in an enviroment with an object caching
- wp_query with custom post type only returning last posted
- Display custom tags on pages that have a specific page parent
- Slow WP_Query with ‘OR’ on meta_query
- How to filter a query by multiple meta keys and order by other meta keys
- Custom query: Get all posts that are from a certain category?
- Transient api Caches confused
- Meta Query doesn’t works as espected
- Media Library Won’t Display Any Images
- Query Posts by Tag and exclude
- More Fields & Media Upload
- How to import a WP backup website into another WordPress hosting?
- Change Image folder Locations
- How to apply a function to a metadata value before launch a WP Query?
- Pagination for custom loop on custom page template is not displaying anything
- Display posts by tag
- Changing titles in Uploader for “Posts”
- Overriding $wp_query on a template
- Writing less unnecessary code with WordPress
- query single random post works localhost, not on live site
- Display count number of posts with the same specific meta_key meta_value
- How to stack name list in non-alphabetical order?
- Replace wp_query with wp_user_query
- How can I use arrays and a foreach to generate many lists with WP_Query?
- Apply a custom WP_Query to the whole multisite network
- display ACF repater field in archive page
- WP_Query breaking the loop in a nested loop
- WordPress Query for CPT that only shows posts within radius of current user’s geolocation
- Meta query ignores multiple values of the key
- How to get user avatar via WPDB
- One of two similar WP Query is very slow
- Woocomerce – Order products by float attribute in archive pages
- Complex Meta Query
- Order search results by multiple post_types
- WordPress conflict with multiple load more posts functions on click
- why default wordpress loop not working outside index.php
- Woocommerce WP_Query post__not_in problem
- Redimension thumbnail crop without creating new images
- Create custom order sortby based on array of id
- How to combine nested tax_query logic with other nested query logic?
- complex query question
- Showing Children of page by name
- WP_Query for liked posts is showing all posts if none are liked
- When should you use WP_Query vs query_posts() vs get_posts()?
- Manipulating a query
- Can’t get pagination to work with this WP_Query loop
- Passing additional variables to a query
- query_vars category_name only display one catgory out of multiple categories
- Use value from meta key array for use in WP_Query
- WP_Query sort by ACF date field (newest first) with blank dates first