Wednesday, August 17, 2016

How to Exclude a Post or Page from WordPress Search Results

I needed to have one post in a site I’m building not appear in search results. I came across this handy bit of code that totally does the trick, and it works for a page, too:

/** Exclude from search */
function mySearchFilter($query) {
if ($query->is_search) {
$excludeId = 199;
$query->set('post__not_in', array($excludeId));
return $query;

Copy and paste the above code in your theme’s Functions file:

Dashboard > Appearance > Themes > Editor > Functions.php

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.

Friday, July 8, 2016

A Funny Thing Happened On The Way To A Support Ticket

No ticket – not an option!  Buh-bye!


My web hosting company, Bluehost, has opted no longer to offer tickets for support. Instead, they are seeking to focus on chat and phone as primary communication channels for website issues.

As someone who has run sites for nearly two decades now, this is unheard of. On one hand, I absolutely understand how support tickets can be a bottomless pit for support staff, often containing not enough information to address an issue.

On the other hand, I’ve often enjoyed the convenience of opening a ticket then getting back to work while awaiting a response, then having it documented as the conversation progressed, sometimes with it being emailed back to me for future reference (from Bluehost & others).

I had an issue with my art website, this morning, and within 10 minutes I opened a chat session and it was resolved. Plus, I’ve had great help from Bluehost’s phone support in the past as well.


So in my own personal experience, not having tickets has been so far, so good. Still, this is a major shift in approach. I reached out to Bluehost support via Twitter for some details, and they confirmed the switch:

I have mixed feelings about this, but hey, if my issues can be resolved faster this way, I’m all for it.

What do you think? Do you prefer phone, chat or tickets for website tech support? Let us hear from you in the comments.