How to Add unlimited Search Results on WordPress

1 Open functions.php on Left Menu/Apperances/Editor

2 Add this code to last line (before ?>)

function change_wp_search_size($query) {

if ( $query->is_search ) // Make sure it is a search page

$query->query_vars[‘posts_per_page’] = 10; // Change 10 to the number of posts you would like to show

return $query; // Return our modified query variables


add_filter(‘pre_get_posts’, ‘change_wp_search_size’); // Hook our custom function onto the request filter

3 Show Unlimited by using -1