Then, replace “199” in this example with the ID of the page or post you want excluded. To find the ID, edit the page or post in the dashboard and look for this number:

You might need to access the Functions.php file in your themes folder via FTP if you have a custom install.

This right here is one of the main reasons I love WordPress. Because it’s open source and so widely-adopted, chances are there’s a solution for whatever basic issue may arise. To find this result I just Googled, “How to exclude page in WordPress search” and was taken to this support discussion from several years ago. Even though it’s from a previous decade, the advice still worked, and I hope it might help you also.

What do you think? Have you ever been led to WordPress forums via Google search for a how-to type of question? How do you prefer to find answers to these issues? Let us hear from you in the comments.