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:
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- WP_Query use for a filter with multiple Taxonomies and Terms
- Duplicates with WP_Query loop
- Display Post co-authored in Author Page
- Display related products with custom output
- How do I dynamically generate args for wp_query?
- Use wp_get_recent_posts with search term
- have_posts() execution failure
- Can’t search posts using WP_QUERY inside AJAX Function
- How can I use wp_query to show all product data using just the products ID?
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Custom page archive query by url var calling page twice on one of my custom queries?
- WordPress pagination not working with search page
- WP Query with custom Shortcode
- How to use an associative array in post__in with WP_Query?
- Display a specific category of products in shop page and disable code for specific actions
- Add more button if more 8 items
- WordPress, AJAX and pre_get_posts using conditional tags
- Exclude posts based on meta value
- Custom query, checking values of multiple meta keys
- Remove echo from shortcode
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Fatal error: Call to a member function query() on a non-object
- Is it possible to retrieve all posts with a certain value for metadata?
- unable to use ‘new WP_Query’ in AJAX call
- wp_query get the 2nd post
- How to add div blocks after certain set of post
- Trouble inputting variable into WP query
- Convert a string into a decimal number for use in query
- Array to string conversion on array_map
- Increment paged on WP_Query
- Target post_date_gmt if it’s empty or not set
- Hide posts if user is added to it WP_query
- How to hide posts of a specific custom category in WordPress?
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Custom query vars filters problem with pagination
- WordPress meta_query >= &
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- Modify main query before it run without pre_get_post
- WordPress WP_Query without query GET parameters
- Sort posts in a specific way
- Dividing the loop to style post differently
- posts_nav_link pulling in multiple post types
- displaying a fall back query if there’s nothing in the post-type category
- Modifying WP URL handing code?
- WP_Query: How to get results from both meta_key options?
- Free search and custom taxonomy query not providing the same result
- How do I reset $wp_query in a function?
- Output product category link from WP_Query
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- wp_query with multiple arguments with AND
- Passing in MySQL prepare statement parameter separately throwing error
- Replace a single variable with add_filter
- Nested Queries of decreasing specificity
- Wrong pagination results, page counter resets when navigating
- Is it possible to order posts using multiple meta queries, i.e. show posts from first meta query, then the second?
- Sending simple variable on single page to WP JSON
- How to exclude meta no index pages from wp_list_pages
- in_array not working on dev server but works on localhost
- meta_query search names when they have middle initials
- Custom search query on WordPress page not working
- WP query posts BUT show the most recent and one per author
- Define global custom post
- posts_per_page displays only 2 posts instead of 4 posts
- get_filtered_term_product_counts – Get product terms if any products
- Need to show 7 posts from actual date
- Search for single post by 2 tags
- Paged WP_Query is quitting on page 3
- Get Child of Child Pages in custom Menu
- List all ACF field values across every post on one page
- Multiple Arrays for Custom Post Query using Boostrap accordions and ACF repeater fields
- Meta query not showing result properly
- Query to show average # of months all accounts with specific role have been active
- Woocommerce Related Product by 2 taxonomy
- Query doesn’t display text data with apostrophes
- making a search.php query
- Querying posts from wordpress with 2 or more conditionals
- Efficient way of querying for a “fallback” post?
- SQL Query Search page
- Can’t get data from audio media
- Create a hierarchical loop at predefined markup requirements
- Display Year and Month from custom field + Age Calculator
- insert thumbnail image from php script
- WP_Query count of different meta key values [duplicate]
- Masonry layout within the loop
- Query seems to be duplicated
- Keeping the previous get value and add another value when submitted
- Fix incorrect related posts code snippet
- wp_query on search results page showing all results every time
- Changing regular db connection to $wpdb
- Variable ++ in query loop
- XML WP_Query problem in PHP 8.0 and 8.1
- a problem in class in class-wp-hook.php
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Count custom posts type and filter by tag
- AJAX WP_Query’s order and orderby parameters not working
- How to sort search result by post_title, then by post_content
- How do I display WooCommerce products in my query to rows of 3?
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress