Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

[SOLVED] Exclude page from Atahualpa search results

Old Oct 25, 2012, 10:36 AM
tracytrends's Avatar
15 posts · Dec 2011
I found how to exclude ALL pages from search results by adding the code below to the functions.php editor, but I want to only exclude one or two pages from search results.

function mySearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
return $query;


I've been unsuccessful trying to Google a solution, so could you please suggest some coding?

thank you
Old Oct 25, 2012, 01:45 PM
juggledad's Avatar
23,743 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try 'wordpress exclude page from search'
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
Old Oct 25, 2012, 02:44 PM
tracytrends's Avatar
15 posts · Dec 2011
Thank you.

One problem I had was where to post the coding. I was just copying it at the end of the edit file but now that I put it before the ?> it works. (probably obvious to coders, but not to me)

I appreciate your time,


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Customize Search Results page when "No Results" vCopia Center area post/pages 2 Mar 1, 2011 08:05 AM
How to exclude one page (large table) from search? eleanorb Atahualpa 3 Wordpress theme 5 Feb 5, 2011 07:28 PM
How to modify search results page unelma Center area post/pages 0 Jun 21, 2010 12:19 AM
Search Results page needs formatting black_cat Atahualpa 3 Wordpress theme 5 Aug 10, 2009 09:55 AM

All times are GMT -6. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.