Skip to main content
This article describes how to customize the number of search results that WordPress displays per page. You may want to do this, for example, if your site only has a few posts or a large number of posts.

Customizing search results

To customize the number of search results displayed per page, follow these steps:
  1. Log in to WordPress as the administrator.
  2. On the Dashboard in the left sidebar, click Appearance, and then click Theme Editor:
    WordPress - Dashboard - Appearance - Theme Editor
  3. In the right sidebar, under Theme Files, click Theme Functions (functions.php).
  4. Copy the following code snippet and then paste it at the bottom of the functions.php file:
  1. Click Update File. WordPress saves the changes to the functions.php file. To test the new code, do a search and confirm that the correct number of results appears per page.