How to exclude WordPress posts or pages from search results

Snippets WordPress
Please Rate this ..

This snippet will allow you to control which posts or pages there should be excluded from WordPress search results.

Instructions
Add this code to your functions.php file.
* In this snippet, posts with the IDs 0 and 1 will be excluded – edit accordingly to suit your needs.

1
Leave a Reply

avatar
0 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Recent comment authors
  Subscribe  
newest oldest most voted
Notify of