If you want to use WP_Query:
$no_title_posts = new WP_Query(array('name'=>'','posts_per_page'=>-1);
That will search all posts with empty name. The posts_per_page = “-1” returns all posts because by default wp returns 10 or whatever number you have selected in your admin settings.
if you want to retrieve it from other posts types (default is “post”), then you will need to specify it:
$no_title_pages = new WP_Query(array('name'=>'','posts_per_page'=>-1,'post_type'=>'page);
Related Posts:
- How do I use WP_query with multiple post IDs?
- Best Practice for PHP
- Include WP_Query in my own PHP file?
- Inject post (from specific category) between posts in Loop
- is_page() not working from within a plugin
- Passing JSON data from WP Query into AJAX causing NULL errors
- AJAX / Read More: multiple check_ajax_referer() and wp_create_nonce() not working independentely
- Display certain amount of posts on taxonomy archive page
- Result of Custom WP_Query appears on 404 Page (but result are found!)
- Show only one post for each author ( Page loads too slow )
- how to display active, upcoming and past event with featured listing with pagination
- How to add 2 posts under another post? Formatting should be intact
- Get list of WP Updates Across Sites
- what is diference wp_get_attachment_url / wp_get_attachment_src / get_post_thumbnail_id?
- Modern Tribe Calendar wp-query with meta query not working at all
- Count number of published posts by type
- How to display custom field on homepage
- WP_Query sort using multiple numeric meta values
- Can an array be used as a meta_query value?
- Can’t increase posts_per_page by variable
- WordPress WP_Query() Not working properly
- Get taxonomy terms only of the WP_Query current posts
- How to get to a specific position in wp_query?
- Get category name from custom loop and echo it once
- Hide post if matches current month and year
- Use WP_Query in shortcode
- Why is variable not working on custom sql query using wpdb?
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- Random order of WP_Query results with highest meta value
- Using foreach loop breaks
- Loading the same WP_Query in two different wordpress .php templates
- How to prevent WP_Query function from returning all posts when empty?
- Dynamic content based on a URL parameter
- Get users that likes the post
- inserting a post from an extern php file but post content doesn’t show on wp site
- WordPress theme options error
- Get posts from multiple post type
- WP_Query fails despite having 1 post
- wp_query get the 2nd post
- How to add div blocks after certain set of post
- the_posts_pagination() not working in wpquery
- WP_Query: getting posts where custom field exists
- Convert a string into a decimal number for use in query
- Increment paged on WP_Query
- Hide posts if user is added to it WP_query
- Custom route and query
- Getting posts to exclude from array
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Custom post type permalinks do not appear using the link functions
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- Modify main query before it run without pre_get_post
- Sort posts in a specific way
- array_rand not working correctly?
- WP_Query() load selected post
- How to extract information from a wp_query result?
- posts_nav_link pulling in multiple post types
- Modifying WP URL handing code?
- orderby meta_value_num is not working, giving default order
- How can I modify this code to make the search box include tags and meta
- Free search and custom taxonomy query not providing the same result
- How do I reset $wp_query in a function?
- WP_Query for woocommerce products with a pattern as a post_title
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Replace a single variable with add_filter
- Sending simple variable on single page to WP JSON
- How to exclude meta no index pages from wp_list_pages
- meta_query search names when they have middle initials
- Ajax filter with loadmore button
- Query by pagename not Working
- Display featured image of post type category
- Delete post meta by serialized meta value
- get_filtered_term_product_counts – Get product terms if any products
- Getting info about selected posts using one WP_Query
- List all ACF field values across every post on one page
- Multiple Arrays for Custom Post Query using Boostrap accordions and ACF repeater fields
- Query to show average # of months all accounts with specific role have been active
- Query doesn’t display text data with apostrophes
- How to return count of items found in SQL query
- Querying posts from wordpress with 2 or more conditionals
- SQL Query Search page
- For each 3 posts, show a different post type
- Display Year and Month from custom field + Age Calculator
- insert thumbnail image from php script
- Masonry layout within the loop
- Weird Behaviour: Not all WordPress Posts appearing
- Query category-specific, paginated posts and allow viewer to change sort order
- wordpress is_main_query() breaks
- allow previews outside wordpress folder (Outsourcing WP previews)
- Advanced Taxonomy query, with 3 post types
- Why does a meta_query break this WP_Query?
- Changing regular db connection to $wpdb
- Variable ++ in query loop
- a problem in class in class-wp-hook.php
- Count custom posts type and filter by tag
- AJAX WP_Query’s order and orderby parameters not working
- Add adjacent post function inside custom recent post function
- How do I exclude the current post from the upcoming post query
- How do I display WooCommerce products in my query to rows of 3?
- Exclude first post from wp query
- How can I save the HTML output of a WP_Query function as a variable?