---
title: How to change the number of search results in WordPress
description: "In this article, you will learn how to change the number of search results WordPress displays upon a blog page search. We will change this using your cPanel account as people have the theme editor disabled for security reasons. ##…"
url: "https://staging2.conorbradley.co.uk/kb/how-to-change-the-number-of-search-results-in-wordpress/"
updated: "2022-05-05"
category: Website Software Setup Guide
tags:
  - cpanel
  - file manager
  - functions.php
  - hosting
  - wordpress
  - wordpress hosting
---

# How to change the number of search results in WordPress

In this article, you will learn how to change the number of search results WordPress displays upon a blog page search. We will change this using your cPanel account as people have the theme editor disabled for security reasons.

## How to change the number of search results in WordPress using cPanel

To change the number of search results displayed follow these steps:

1. Log in to your cPanel account.
2. Search for file manager then click it.
3. Open your WordPress installation (usually public_html) then navigate to the following wp-content/themes/\[your current theme\].
4. Find the functions.php, right-click, edit.
5. Paste the following code at the very bottom.
    **function control_search_results() {**
    **if ( is_search() )**
    **set_query_var('posts_per_archive_page', 15); // Change number 15 to how many search results**
    **}**
    **add_filter('pre_get_posts', 'control_search_results');**
6. Press save in the top right.
7. Go to your wordpress site and check the code is working correctly.

![changing functions.php file in cPanel for wordpress search results conor bradley digital agency](https://staging2.conorbradley.co.uk/wp-content/uploads/changing-functions.php-file-in-cPanel-for-wordpress-search-results-conor-bradley-digital-agency.png)

 [Facebook](https://www.facebook.com/conorbradleydigitalagency) | [Twitter](https://twitter.com/ConorAgency) | [Instagram](https://instagram.com/conorbradleydigitalagency) | [LinkedIn](https://www.linkedin.com/company/conor-bradley-digital-agency)  | [Youtube](https://youtube.com/conorbradleydigitalagency) | [Vimeo](https://vimeo.com/conorbradleyagency) | [Blog](https://staging2.conorbradley.co.uk/blog/) | [Knowledge Base](https://staging2.conorbradley.co.uk/kb/) | [Client Area](https://billing.conorbradley.co.uk/login) | [Google Business](https://g.page/r/CUSmNJ3lhko9EBA)
