It is not that hard to enforce a hard limit on results:
add_action(
'post_limits',
function($limit) {
$limits = explode(',',$limit);
if (isset($limits[1]) && 2000 < $limits['1']) {
$limits[1] = 2000;
}
$limit = implode(',',$limits);
return $limit;
}
);
I would not be surprised if that does not solve your problem though. Just searching over that many posts may be too much for your server, no matter what the limit is on the returned results.
I am also not 100% sure that that will not break things. Be careful.
You could use 'no_found_rows'=>true
for any queries that do not need pagination. That might help.
Ultimately, I suspect that you are just doing too much for your server and/or you need someone who is very, very good with server configuration to help you tweak settings and possibly load balance.
Related Posts:
- Restrict users from editing post based on the age of the post
- Function to show random posts from a category
- wp trim function not working
- How to change the case of all post titles to “Title Case”
- Dynamically add id to heading tags
- Restrict access to post if it is currently being edited
- How to Display Post View Count
- $post object is null
- Hiding posts in a list from specified categories
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Order posts alphabetically: how to set order=asc in mysql query?
- query post limits
- Get post meta retrieving wrong value
- Adding a user’s ID behind the tag ref link address
- How to only publish posts with image in it
- How to check in functions.php if there is data in a WP_Query?
- Get post by tag
- Query function not executed between element [closed]
- How to correctly escape data
- User driven content problems
- How can I create a menu items from meta box based on users input
- List direct children of page
- How *not* to show the last post on the latest posts list
- Display a custom field rating system in the front end
- How to modify this function to exclude also the post belonging to a specific category?
- Display a query with multiple post types and same relationship on a single page
- Update all posts automatically when using post_meta
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Number of posts per page setting is not working?
- List only child categories a post is in, of a specific parent category
- Can’t show comments count per post outside loop
- How to change post status from publish to draft using hook in wordpress?
- Limit Authors to their Own Posts on front-end excluding admins
- Allow role to delete posts but block him the wp-admin
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- WP_Query in functions.php overrides global $post object, even with wp_reset_query()
- Limiting the number of posts in WP_Query leads to unexpected result
- how to set beforsend option in wordpress ajax methods
- Ajax posts filter by date, comments, top views, top likes
- Prepend or add an Image to the content of a Post
- Logged in user ID as post ID
- Most liked page not displaying posts
- Why is querying posts messing up my pages?
- Get post id in a function when edit/add a post
- How to do set post permalinks using 6 digit random unique function?
- Limit 1 global comment per minute
- Multi row post list
- Display post x of y within category
- WordPress Automatic Filename Changer
- posts_per_page option limits the number of Gallery items
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- How to list posts from a plugin taxonomy?
- Adding bootstrap classes to video shortcodes
- Pagination on Custom Post
- Query for first 3 posts to change the look and feel
- Add custom text automatically on each post
- How to give classname to post if post has no content?
- How to use mysql LIKE with wpdb?
- WordPress post filter menu
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- Related Posts: Changing Function For Posts Per Page
- WordPress query portfolio posts
- Same post appears in related Posts?
- Display message depending on capability outside loop
- Display 3 posts with different HTML markup using a loop
- query for filtering published posts?
- Set Default Post as Parent Child (Nested) Relation
- AWS usage queries
- Pull in posts using post meta for REST API
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- how to show comments only author which send own posts in wordpress
- get category in list of posts // shortcode for custom related posts
- Alt text attributes not showing over portfolio images
- posts_per_page displays only 2 posts instead of 4 posts
- Is there anyway I can call the year once?
- How to fetch courses in all languages in WordPress?
- How to show post views shortcode data for each post on Posts List Page?
- How to center all text body in single.php at once?
- Set a post expiration and delete a post when expirate
- Excluding tag Link from html tags in Post content
- Show 5 posts and than 3 posts offset with pagination
- Get post id outside loop : Notice: Trying to get property of non-object
- WP_Query to get posts in a specific tag or has post_format
- Make recent post display recent updated, instead of recent published
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- im trying make a function to auto correct posts when i open the posts in the backoffice
- Sort / Filter Queries
- get_page_by_title() not working if special characters are present
- Show only top 3 posts from 3 categories in order on home page
- How do I control the fallback query after the original query returned cero posts?
- Insert wordpress tags below posts via functions.php
- How to get posts from network blog
- Remove duplicated posts in the loop if post has more than one category
- Adding a category at even positions on main loop with modified pagination
- How to limit post query to only return a total count of items with certain post statuses?
- Not displaying any articles on a custom made file
- How do we display a certain category type on a page while hiding all others?
- What function does the loop of displaying posts?