Try 'post_status' => 'publish',
that should do the trick.
See https://developer.wordpress.org/reference/functions/get_post_statuses/ for more details.
Related Posts:
- Show scheduled posts in archive page
- Load comments per post on click with AJAX
- Show top level comments ordered by number of replies
- How to check for specific content in comments in the loop
- Update status of all posts in a category
- How to display pending posts on the homepage only for editors
- Conditional: IF current user has NOT commented on current post (not including post author)
- displaying recent comments outside loop without plugin
- Include future posts in tags and in search
- Use have_comments() for current post instead of last post in loop
- Comments_template doesn’t work
- how to get author comment inside the loop?
- Make custom WordPress comments list
- display only parent replies count in index.php
- show posts from one category with comments only
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- How to get Author ID outside the loop
- remove tags from the_content
- the_title() shows title of the first post instead of the page title?
- Why do themes rely on “The Loop”?
- How to place comments_template(); outside the loop?
- Endless loop with wp_insert_post and wp_update_post
- Hook into the loop via a plugin, and output something after every X post?
- Two custom loops, pagination, offset
- What exactly defines a Main Loop and a Secondary Loop?
- Loop code is displaying pages but not actual posts
- Access to Media Library
- Getting two wp_link_pages output
- post loop causes wp_users and wp_usermeta DB queries for each users
- Ajax loop refresh on click
- Run The Loop over array of post objects
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Enable infinite scroll on single.php [closed]
- Display posts with comments closed, with pagination?
- Is get_posts() more efficient than The Loop?
- loop through all posts memory error
- How to retrieve “sticky” post outside the “loop”?
- Targeting a Certain Post in Loop (CSS)
- code suddenly appearing from my tempate second loop
- Get post/page data outside the loop
- Display most viewed post from last 30 days is not working correctly
- Split loop to load WordPress gallery into Bootstrap modal and carousel
- woocommerce get_price_html not pulling in correct price
- Trouble Formatting DateTime
- Order archive results by post id in custom taxonomy template
- How to fix pagination for custom loops?
- pre_get_posts for two loops on same page
- Sort results by groups of numbers and letters
- Modify the main loop to display current month / year
- Problem with displaying HTML content after in_array [closed]
- Loop for sticky posts
- Get author_id in wordpress
- Single.php different behaviour from admin to non-admin
- WordPress Blog has an infinite redirect loop
- Array ids post to function have_post
- Can’t access PHP array inside script localization from javascript
- ACF – add a group inside a repeater [closed]
- How to create bootstrap grid loop?
- Give each posts in a loop a number in sequence
- Get post offset/posts page offset in single post page (outside the loop)
- First article : single column; Other articles : 2 columns
- How can I access specific posts brought back by query_posts?
- Separate First Post Loop
- add offset to archive page
- Category ID returns as ‘0’?
- make get_post work in the loop
- How to display 3 post per slide
- For Each +1 WordPress Loop
- Loops for cat links not looping for wordpress site
- How / where is the wp_query object created for RSS feeds?
- Skip 5 latest post while paging?
- WordPress: query pages except remove one page
- get_post_meta printing empty fields, but it shouldn’t be
- Is it possible to set archive.php instead of index.php to display blog?
- How to read taxonomy in loop?
- get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title
- Undefined index: page in loop load ajax content
- how to add 4 post in one carousel slide
- Exclude Posts Using Meta Query and User Meta
- Is “the loop” a template tag?
- Show a list of user posts in the user admin page
- Deeply Nested Menu Loop with Twig using Timber [closed]
- WordPress with woocommerce custom query
- Get featured image outside the loop using foreach
- Page gets displayed in post field
- Active class for my flexslider in WordPress
- setup_postdata in “loop-handling” php file called via $.ajax
- get_template_part() to render single page Theme
- Can’t see custom field after the Loop [closed]
- Showing related posts (custom post type) outside of the loop
- Same Loop on Multiple Pages
- get all page templates
- The Loop for my theme with static front page is not working
- WordPress loop: Display if posts exist
- strange parse error when including a loop template within another template
- Previous Posts Link and Next Posts Link Show All The Same Articles?
- Showing ads after posts in home page
- Undefined variable: woocommerce_loop [closed]
- wp_mail function not working in user query loop
- How to set and retrieve cookies while in the loop