How to Exclude Specific Pages, Authors, and More from WordPress Search

Do you want to exclude specific pages, authors, and more from WordPress search? By default, WordPress search includes all posts and pages in the search results. In this article, we will show you how to easily exclude specific pages, posts, authors, categories, and more from WordPress search results.

Exclude pages, authors, category, tag, and more from WordPress search

Why Exclude Items from WordPress Search?

The default WordPress search feature shows results from all WordPress posts, pages, and custom post types. This is acceptable for most websites and does not affect WordPress SEO or performance.

However if you are running an online store, then there are some pages that you may not want to appear in search results. For example, the checkout page, my account page, or a thank you page after successful downloads.

Similarly, if you are running a WordPress membership website, or a LMS plugin, then there would be pages and custom post types on your website that you may want to exclude from search results.

Some website owners may want to hide a category or taxonomy, while others may want to hide posts from specific authors. Optimizing your site-search by excluding unnecessary items offers a better user experience and improves your website’s usability.

That being said, let’s take a look at how to easily exclude items from WordPress search.

1. Exclude Specific Posts, Pages, and Custom Post Types from Search

The first thing you need to do is install and activate the Search Exclude plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, edit the post, page, or custom post type that you want to exclude from the search result. On the edit screen, you will see a search exclude box.

Exclude from search box

Simply check ‘Exclude from Search Results’ checkbox and don’t forget to save your post/page. This particular post/page will not appear in WordPress search results anymore.

To view all the items that you have excluded from search, go to Settings » Search Exclude page. Here you will see a list of items you have excluded from WordPress search results.

Content you have excluded from WordPress search

If you want to remove the restriction, simply uncheck the box next to the item you want to add back and click on the save changes button.

2. Exclude Specific Category, Tag, Custom Taxonomy From WordPress Search

This method requires you to add code to your WordPress website. If you haven’t done this before, then check out our guide on how to copy and paste code snippets in WordPress.

First, you need to find the category ID that you want to exclude.

Next, you need to add the following code to your theme’s functions.php file or a site-specific plugin.


function wpb_search_filter( $query ) {
	if ( $query->is_search && !is_admin() )
		$query->set( 'cat','-7' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );

Don’t forget to replace 7 with the ID of category you want to exclude.

Now, let’s suppose you want to exclude more than one category. This is how you will modify the code to exclude multiple categories.

function wpb_search_filter( $query ) {
	if ( $query->is_search && !is_admin() )
		$query->set( 'cat','-7, -10, -21' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );

We have simply added the category IDs that we want to exclude separated by commas.

Exclude Specific Tags from WordPress Search

If you want to exclude posts filed under specific tag, then you can use the following code.

if ( $query->is_search && !is_admin() )
		$query->set( 'tag','-19' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );

Don’t forget to replace 19 with the ID of tag you want to exclude.

Similarly, you can modify the code to exclude multiple tags as well.

if ( $query->is_search && !is_admin() )
		$query->set( 'tag','-19, -27, -56' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );

Excluding Specific Terms in a Custom Taxonomy From WordPress Search

If you want to exclude a term in a custom taxonomy from WordPress search results, then you will need to add the following code.


function wpb_modify_search_query( $query ) {
	global $wp_the_query;
	if( $query === $wp_the_query && $query->is_search() ) {
		$tax_query = array(
			array(
				'taxonomy' => 'genre',
				'field' => 'slug',
				'terms' => 'action',
				'operator' => 'NOT IN',
			)
		);
		$query->set( 'tax_query', $tax_query );
	}
}
add_action( 'pre_get_posts', 'wpb_modify_search_query' );

Don’t forget to replace ‘genre’ with the custom taxonomy and ‘action’ with the term you want to exclude.

3. Exclude Specific Author From WordPress Search

If you want to exclude posts created by a specific author from WordPress search result, then there are two ways to do that.

If the author has just a few posts, and you are sure they will not be adding any more posts, then you can just use the first method in this article to exclude their posts from WordPress search.

However if there are a lot of posts written by an author, then you can use the following code to exclude all of them from WordPress search results.

function wpb_search_filter( $query ) {
	if ( $query->is_search && !is_admin() )
		$query->set( 'author','-24' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );

Don’t forget to replace 24 with the user ID of the author you want to exclude.

You can also use the same code to exclude multiple authors by adding their user IDs separated by comma.

function wpb_search_filter( $query ) {
	if ( $query->is_search && !is_admin() )
		$query->set( 'author','-24, -12, -19' );
	return $query;
}
add_filter( 'pre_get_posts', 'wpb_search_filter' );

We hope this article helped you learn how to explude specific pages, authors, and more from WordPress search. You may also want to see our list of the best WordPress search plugins to improve your site search.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Exclude Specific Pages, Authors, and More from WordPress Search appeared first on WPBeginner.

The Best 50+ WordPress Themes for Personal Resumes

Personal resume themes are WordPress themes that act as an extension of your business card as well as an online version of the traditional resume you’d typically hand over to potential employers. They feature all of the typical sections you’re used to seeing on a resume, including your skills, your education, your work experience, projects ... Read moreThe Best 50+ WordPress Themes for Personal Resumes

The post The Best 50+ WordPress Themes for Personal Resumes appeared first on Learn WordPress with WPLift.

The Best Free WordPress Themes June 2018

We’re at the end of the month, so it’s time for a look at the best Free WordPress Themes that have been released. Here is our choice of the best free themes for June 2018. The Best Free Themes of June 2018 Blossom Coach As we all know, mental health and success are the two most important ... Read moreThe Best Free WordPress Themes June 2018

The post The Best Free WordPress Themes June 2018 appeared first on Learn WordPress with WPLift.

How to Add Specific Posts to WordPress Navigation Menu

Do you want to add specific posts to your WordPress navigation menu? Menus in WordPress can be fully customized, and you can add custom links, pages, posts, categories and more. In this article, we will show you how to easily add specific posts to WordPress navigation menu.

Add specific posts to WordPress navigation menu

When and Why Add Specific Posts to Navigation Menu?

Navigation menus allow you to create a navigational structure for your website. This helps users quickly find the most important sections of your website.

WordPress makes it very easy to create and add navigation menus on your website. By default, it shows sections to easily add pages, categories, custom links, and more.

Adding items to navigation menu

Normally website owners add pages to their navigation menus like about page, a separate blog page, pricing page, or a contact form page.

Some websites add categories to navigation menus which allows users to quickly jump to different topics on their site.

Categories and topics in navigation menu

However, sometimes you may need to add an individual post to your navigation menu. This could be your most popular post or something that you would like your users to find quickly.

That being said, let’s take a look at how to easily add specific posts to WordPress navigation menu.

Adding Specific Posts to WordPress Navigation Menu

First thing you need to do is go to Appearance » Menus page in your WordPress admin area and select a menu to edit. You can also create a new menu and use it as your navigation menu.

Select menu to edit

After selecting the menu, you’ll see tabs for pages, posts, custom links, and categories. You can click on each tab to expand it.

Options for menu

If you cannot see the Posts tab there, then you need to add it by clicking on the Screen Options button at the top right corner of the screen.

Add post box

Once the Post box appears, you need to expand it to select the specific posts that you want to add to your navigation menu and click on the Add to Menu button.

Select specific posts

After adding the specific posts to the navigation menu, you can drag and drop menu items to adjust their display order.

Drag and drop menu items

You can also customize the label to change the post title into a smaller title. Make sure to save it and visit your website to see your WordPress navigation menu with specific posts in action.

Navigation menu with specific posts

Navigation menus can be further customized to add search bar, social media icons, log in / log out links for your blog, post type archive, and more. You can also style your navigation menus to change their colors and appearance.

We hope this article helped you learn how to add specific posts to WordPress navigation menu. You may also want to see our expert pick of the best tutorials to master WordPress navigation menus to easily customize and manage your blog navigation.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add Specific Posts to WordPress Navigation Menu appeared first on WPBeginner.

WordPress Training: Where To Find Courses And Videos To Up Your Skills

You know WordPress is awesome – but you want to be better at it. So how do you get better? The same way you get better at anything – you get some WordPress training. And with the huge variety of WordPress training videos and courses, it’s never been easier to up your WordPress skills – ... Read moreWordPress Training: Where To Find Courses And Videos To Up Your Skills

The post WordPress Training: Where To Find Courses And Videos To Up Your Skills appeared first on Learn WordPress with WPLift.

Jupiter v6 Theme Review: The Next Generation of Jupiter

In this Jupiter v6 WordPress theme review, we’ll be taking a look at the newest version of this impressive multipurpose theme. Whether you are a blogger, business, marketer, or are looking for a theme for a different niche, Jupiter, with its wide range of templates, design elements, and unlimited customization options, could be the theme for ... Read moreJupiter v6 Theme Review: The Next Generation of Jupiter

The post Jupiter v6 Theme Review: The Next Generation of Jupiter appeared first on Learn WordPress with WPLift.

ARForms WordPress Form Builder Plugin: The Ultimate Review

ARForms WordPress form builder plugin is a popular solution for building a range of fully responsive forms: a basic WordPress contact form, a workshop registration form, surveys, a job application form, and many more plain and complex types of forms. ARForms plugin has been around successfully for more than 4 years now. During this time, ... Read moreARForms WordPress Form Builder Plugin: The Ultimate Review

The post ARForms WordPress Form Builder Plugin: The Ultimate Review appeared first on Learn WordPress with WPLift.

How to Create a Net Promoter Score® (NPS) Survey in WordPress

Do you want to create a Net Promoter Score (NPS) survey in WordPress?

Net Promoter Score is a popular method to measure customer loyalty, so you can improve your brand image, find new product ideas, and provide better customer service.

In this article, we will show you how to easily create a Net Promoter Score® Survey in WordPress, and how to properly use it to improve your business.

How to create a net promoter score survey in WordPress

What is Net Promoter Score?

Net Promoter Score is a management tool that helps businesses measure customer loyalty. The idea was first introduced in 2003, and since then more than two-thirds of Fortune 1000 companies have adopted it.

Here is how it works.

It is based on a single question, ‘How likely are you to recommend our company/product/service to a friend or colleague?’

The answer is provided on a scale of 0 to 10.

NPS survey form preview

Customers who respond with a score of 9 or 10 are called ‘Promoters’. These are your brand’s most loyal customers and are highly likely to purchase again and recommend your business to others.

Users who answer with a score between 0-6 are considered ‘Detractors’. These are the customers who are unhappy with your business and are least likely to purchase or recommend your business.

Customers responding with a score of 7 or 8 are called ‘Passives’. They can be either promoters or detractors and are less likely to actively recommend your business and products to their friends or colleagues.

Your final NPS score is calculated by subtracting the percentage of detractors from the percentage of promoters. The overall score ranges from -100 to 100.

A -100 score means all customers are detractors and a full 100 score means all customers that took part in the survey were promoters. Normally, a score of positive numbers (0-40) is considered good, and a score of 50 or above is considered excellent.

Due to the popularity of NPS surveys among businesses, there are numerous very expensive survey tools that will charge you hundreds of dollars per month. These solutions are not very affordable for small businesses.

Luckily, you can use a WordPress survey plugin by WPForms which helps you create powerful NPS surveys at a fraction of the cost.

Let’s take a look at how to create a Net Promoter Score survey in WordPress.

Creating a Net Promoter Score (NPS) Survey in WordPress

The first thing you need to do is install and activate the WPForms plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

WPForms is a paid plugin, and you will need at least their Pro plan to access the surveys addon used in this tutorial.

Upon activation, you need to visit WPForms » Settings page from your WordPress to enter your license key. You can find this information under your account area on the WPForms website.

Entering the WPForms license key

After entering your license key, you need to visit the WPForms » Addons page and locate the ‘Surveys and Polls Addon.’

Go ahead and click on the ‘Install Addon’ button. WPForms will now install and activate the addon.

Install surveys and polls addon

You are now ready to create your first Net Promoter Score survey form.

Head over to WPForms » Add New from the WordPress admin panel to create a new form. First, you need to provide a title for your form, and then select a form template.

WPForms offers lots of prebuilt form templates. You can simply search for an NPS form template from the search bar on the left.

For this tutorial, we will use the ‘NPS Survey Simple Form’ template.

Select a NPS survey form template

WPForms will now load the form builder interface with some typical survey form fields.

This is a drag-and-drop form builder where you can just point and click to edit any existing form fields or add new fields from the left column.

Edit your NPS survey

If you click on the existing fields in the form, then you’ll see more options for customization.

For instance, you can change the text for each question and make it a required field.

Customize each NPS survey field

Your Net Promoter Score survey form is now almost ready. Simply getting the score is not very helpful because you don’t know why these customers are unhappy or happy.

Let’s add some smart conditional fields to the form to get more helpful feedback from users.

Adding Conditional Logic to Net Promoter Score Survey Form

WPForms comes with a smart conditional logic feature that allows you to show or hide form fields based on the user’s answers to previous form fields.

You can use that feature to ask users for more feedback based on their answers. For example, you can ask users who select a score between 0-6 to give you another chance to make things right. These customers are unhappy and asking them for an opportunity to make things right will help you improve your relationship with these customers.

Similarly, you can also ask users giving a score between 9-10 to leave a testimonial and ask for their permission to share it on your website. These are your most loyal customers, and their testimonials can help you add social proof to your website.

Let’s add these conditional fields to your NPS survey form.

First, select the question after the NPS scale. Next, switch to the ‘Smart Logic’ tab from the menu on your left and click the ‘Enable Conditional Logic’ toggle to enable the option.

Enable conditional logic

We only want to show this field to users responding with a score between 0 and 6. To do that, we will add conditional logic to this form field.

WPForms will add the logic by default. However, you can edit the rating for which you’d like to show the survey question.

Similarly, you can set up conditional logic for the second question in the survey. By default, WPForms will set the condition for you and only show the field when the score is between 7 and 9.

Conditional logic for second question

You can edit these conditions according to your survey needs. However, if you’re just starting out, then we recommend using the default settings.

Now repeat the process for other questions in the form. Don’t forget to save your changes.

Adding Your Net Promoter Score Survey in WordPress

WPForms makes it super easy to add forms to any post or page on your website.

You can simply click the ‘Embed’ button inside the form builder to get started.

Click the embed button

Next, you’ll see 2 options to embed the NPS survey. You can create a new page or select an existing page.

We’ll choose the ‘Create New Page’ option for this tutorial.

Embed a form in page

After that, a popup window will open.

Simply enter a name for your new page and click the ‘Let’s Go’ button.

Enter name for your new page

Next, you should see your NPS survey form embedded in the content editor.

Alternatively, you can also use the WPForms block to add the NPS form anywhere on your website.

Add a WPForms block in wordpress

Simply click the ‘+’ button to add the WPForms block. After that, select your form from the dropdown menu.

You can now save your changes and visit your website to see the form in action.

NPS survey form preview

Now, whenever a user selects a score between 0 to 6, they will see another form field asking for their feedback.

Viewing Your Net Promoter Score Results

After your form is live, WPForms will start calculating your Net Promoter Score based on survey results. You can send the NPS survey link to your customers using an email marketing service to encourage them to fill it out.

After a few users have filled out the form, you can go ahead and check your score.

To do that, head over to WPForms » All Forms from your WordPress dashboard and click on the ‘Survey Result’ link under your Net Promoter Survey form.

View survey results in WPForms

WPForms will now display your total Net Promoter Score along with the number of promoters, detractors, and passives. It will also break down the results into beautiful charts, bars, and graphs.

You can use the feedback from users to improve your product, add new features, as well as offer support to unhappy customers and turn them into loyal brand evangelists.

View NPS survey results

We hope this article helped you learn how to easily create a Net Promoter Score (NPS) survey in WordPress. You may also want to see our article on how to choose the best WordPress hosting and how to get free SSL certificate for your WordPress site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Create a Net Promoter Score® (NPS) Survey in WordPress first appeared on WPBeginner.

Weekly WordPress News: The Gutenberg Roadmap Is Out

As part of WordCamp Europe, Matt Mullenweg laid out the roadmap for Gutenberg over the next three months. In July, there will be a prompt to push more Gutenberg usage (as a plugin). Then, we might see a WordPress 5.0 beta in August. Automattic, the company behind WordPress.com also made a big acquisition. And in even more ... Read moreWeekly WordPress News: The Gutenberg Roadmap Is Out

The post Weekly WordPress News: The Gutenberg Roadmap Is Out appeared first on Learn WordPress with WPLift.