Redirect To Post If Search Results Return One Post

Wordpress has a built in search functionality which allows your visitor to easily search for posts on the blog. It can search for keywords in the post title and in the post content. When a search is performed WordPress will use the search.php file to display you the results. You can customise this page to display the entire list of posts returned from the WordPress database. The problem is that

Read more...

Display A WordPress Search Form

Wordpress has an built in search facility which will allow you to search for keywords within your posts search in either the post title or the post content. In order for WordPress to perform a search on your posts and return the search results page it will need to have a $_GET variable of s. When WordPress finds this query string parameter it will perform a search on the value

Read more...

Add Search Form To A WordPress Menu

Wordpress comes with the functionality to create menus in the dashboard area, from here you can select pages or custom custom menu items to make up your menu. Menus are normally going to be display at the top of the page to give the visitor easy access to your main pages. But this top navigation bar is also a good place to have your search box so if people can't

Read more...

How To Exclude Posts From WordPress Search

There may be times when you have a little rant of make a mistake in a post and want to exclude this from the in-built WordPress search functionality. There is a way you can intercept the WordPress search functionality and exclude certain posts from being displayed. All you have to do is find out the post ID and add it to the following function in your functions.php file. First you

Read more...

Include All Custom Post Types In WordPress Search

Since WordPress version 3.0 you can now create your own custom post types. WordPress already comes with post types for things such as posts, pages, attachments, revisions and menus. Custom Post types allow you to create your own content item. These are commonly used for portfolio slides and news articles. The problem with custom post types is that they are not included in the WordPress search functionality you can only

Read more...

Redirect WordPress Searches

WordPress comes with it's own in-built search functionality which can search the title and content of all your posts on your WordPress site. To perform a search on your WordPress site all you have to do is create a search form which posts a GET parameter s to the home page of your WordPress site.

Read more...

Limit WordPress Search To Post Titles

By Default wordpress search functionality will search the entire content of the WordPress post. What if you don't want WordPress to search the entire content of the post, you can actually change the search functionality to only search the post titles. Copy the following into your functions.php file or create a plugin with this snippet in to make sure WordPress only searches on post title.

Read more...

WordPress Query Arguements

The WordPress WP_Query functions allows you to pass in an array of parameters to search your posts on your blog. You can pass in multiple different parameters to narrow down the posts to get exactly what you need. But with this massive flexibility you can get confused as to what you can exactly query on.

Read more...

WordPress Robots.txt Optimization

The purpose of the robots.txt file is to direct search engines to where they can index and where they are not allowed to index. It is recommended by all search engines to use this robots.txt file so that they don't waste time and resources crawling and indexing files which you don't want them to be indexed. Here is what WordPress recommends your robots.txt file to look like.

Read more...

How To Create Pretty Search Forms

In this tutorial we are going to style text boxes and buttons to create pretty search forms. We are going to create three forms which will match the image above. The three styles are dark grey, light grey and a lighter grey just like the image below. The HTML Each of the search forms will have a textbox and a button which we can submit the search.

Read more...

1 2