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
- Removing filename searches when searching attachments
- Trying to output content from page, works locally but not online
- Add category to my get_post query
- Ajax (jquery) wp_query pagination returns -1
- Why always one post missing
- Query WP Page for Buddypress Group Home [closed]
- How to sort by most watched in X days/months
- Admin: Custom Query Returning Permissions Error
- Using WP_Query with multiple loops on one page in search.php
- Modify output of custom loop using WP_query
- Help with Wp Query
- What’s wrong with this wpdb query?
- How to stack name list in non-alphabetical order?
- Media attachment date and post date
- How to get pages of parent (non-recursive)?
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Display upcoming events in the next 30 days by querying posts with timestamp in custom meta
- orderby ignored by wp_query
- How can I change the term “Published” next to # of posts published on WordPress dashboard All Posts page?
- Multiple loops breaking side bar
- $post in wp_query?
- Having a variable based on $post_count increase when i move to the next page of results
- Post order by custom fields
- WP_Query and pagination AGAIN?
- WP Query get only 1 post (sticky, not sticky etc)
- WP Query and multiple pages
- how do I write this wp_query select statement?
- Page template doesn’t display simple HTML if inserted into other page?
- WP_Query not returning correct result with meta_query parameter
- How to pass the current content of $wp_query to a new page?
- How to make the ‘request’ filter work?
- problem with the loop
- How to use rewind_comments() – when and how to use it?
- Trouble passing attribute into shortcode function
- How to make a query returning pages from multiple parents
- How can I build a query that returns all attachments of a page and it’s children pages?
- how to put thumbnail below category’s title?
- What’s missing in this wp_query and meta_query
- Prioritising and Ordering Posts By Category Name Using A Custom Loop
- Where is this query?
- Is there ANYTHING about this query that’s incompatible with WordPress 2.9.2?
- WP_Query Pagination
- wp query remove posts from query then update max pages and posts found
- Order by post meta not working with pre_get_posts filter
- The Events Calendar, wp_query returning event date not published date
- WP Query orderby ACF boolean values and ACF field value
- Uploaded images result in a file url with full path on disk appended
- tax_query in pre_get_posts
- Adding query parameter to archive page returns 404
- Sort posts using multiple custom fields and menu_order in single query?
- Optimising WP_Query with ACF Fields
- Searching not only by post name but also category
- meta_query where the meta value is not the post title
- $wp_query->found_posts not returning correct value
- WP_Query, Paginate by Custom Field
- get_the_terms has strange result since version 6.0
- Elementor posts custom query based on tag [closed]
- How to display posts from custom post type category(custom Taxonomy) wise?
- meta_query weird behaviour, static int will work, but not user data
- Query post and sort by custom value calculated with custom field on cpt
- Can’t get term id for category archive
- How can I do a orderby by the number of items? So basically list by starting with the array with the largest number of post
- How to make a post with certain taxonomy term display first before other post with only one query?
- Exception for excluding previously displayed posts in queries
- How can I return only IDs from the `posts` REST endpoint?
- Post incorrectly excluded when using “category__in”?
- get_children() Archive Template
- Change image data durgin upload
- How to get all user posts from two post types in wp_query
- WordPress not showing manually uploaded files in Uploads folder on Media Library
- Query multiple post types, but different order for each
- How to search by slug and old slug in single API
- Related posts by current posts child category
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- WP_Query retuning empty array in rest api