Notifications
Clear all
Sponsor: Best Web hosting 20x faster, cutting edge tech at $5/m
Sponsor: Up to 70% OFF VPS Web Hosting
Sponsor: Receive $100, to test: SSD VPS Servers, Cloud Servers and Cloud Hosting
Topic starter
hi,
You need to locate first your Functions.PHP file inside of your theme folder then paste this code inside of it.
function SearchFilter($query) { if ($query->is_search) { $query->set('cat','0,1'); } return $query; } add_filter('pre_get_posts','SearchFilter');
'0' & '1' are IDs, these Ids are found on your browser when you preview a specific post or a page.
ex: https://tronictalk.com/wp-admin/post.php?post=1338&action=edit this post id is:1338.
Search for IDs of the specific post or page that you want to hide from search then change '0, 1' with those Ids.
Posted : 19/04/2021 1:05 pm
Ronny reacted