Advanced search settings in WordPress

 advanced search wordpress

The search form that we have years ago in WordPress is perhaps one of the most used elements by any user but is nothing short of simple, does not allow you to refine the results by label or category for example.

A standard search form in WordPress is usually something like this:

This will give us the standard result, without discriminating anything, but the reality is that the search form can be greatly expanded to make better searches through a good number of plugins, but what you might not know is that there are lots of parameters that can be added to a form to improve it:

  • attachment
  • attachment_id
  • author
  • author
  • cat
  • category_name
  • comments_popup
  • day
  • error
  • feed
  • hour
  • hour
  • m
  • minute
  • monthnum [19659068] name
  • p
  • page_id
  • paged
  • pagename
  • post_parent
  • post_type
  • preview
  • second
  • static
  • subpost
  • subpost_id
  • tag
  • tag_id
  • tb
  • w
  • year

Best of all, they are variable that you can use with WP_Query for to create some great, and much more functional search forms using HTML and PHP .

… Search form by category …

You can search manuals using the variables defined above, but discriminating by category. An example would be something like this:

But it is much more elegant, and less demanding for our visitors to improve our search form. We could, for example, modify it so that it can choose between several categories, something like this:

Although it would be much more useful to allow you to choose between whole s the categories in this way:

 search engine with list of categories

… Form search po r label …

As for the categories, you can also search by discriminating by tag, something like this:

But, again, it's much better to be less demanding with our readers and make life easier for them, just like before, let them refine searches by choosing tags:

Or allowing you to choose from all existing ones:

]  search engine with list of tags

… Form of search by multiple parameters …

But what if we want the user to be able to search in, say, several tags at once, not just one. In addition, to achieve this there is no URL that gets it, so if or if we would have to create a form of this type:

But, do the test, type this other too right here:

You get what same!

So why do the search results that give you the native form offer the horrible permalinks? The case is that the function to give you the result with the good permalinks exists in WordPress but the rewrite does not work .

Fortunately everything has a solution, and Bavota ] has written a function that, added to the file functions.php of your active theme gets the rewrite to work as it should, is:

Save and that's it, from now on all your permalinks of search results will be of type tusitio.com/search/palabra

NOTICE : this publication is from two years ago or plus. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Show Google that your blog deserves to be first!

 prove to google that your blog deserves to be first

In our previous article we have reviewed some basic techniques for improve positioning from our wordpress blog on Google . Now we will review another very important point to continue optimizing our blog to the search engines.

I see very often that many bloggers publish all the content of their posts directly on the Home page …
Serious error for your positioning in Google!

Why?

Suppose your post is interesting and draws your user's attention … This will enter the Home of your blog, observe that there is information that interests you, read the article and possibly close the browser and continue your work day (glad to have received the knowledge that you have given). And your only benefit would be an additional visit to your statistics.

Let me tell you that this is not as beneficial as it seems, it could even be a disadvantage. The reason is that this user will increase the bounce rate of your blog (an SEO factor very considered by Google when making your search rankings).

The recommendation is to use the excerpts from articles in Home (three or four lines describing the content of your article). In this way, when the user enters Home, they will see only the title and extract of the article. You will notice that it is information that interests you and will press "click" to see the full article. This click is very valuable in the eyes of Google, since it is a sign of interest to the content of your blog (a sign of interest emitted neither more nor less than by a user, the main objective of Google).

If a high percentage of your users "click" on the excerpts or internal links of your blog, speak of interest and satisfaction in the content that you publish. Therefore, you have a very favorable point for Google to want to show your content to users and make you climb positions in your ranking 🙂  Google Analytics Bounce Percentage

And how does Google realize if the user clicked at least once on my site?

If you use Google Analytics (which is very likely because we all love this wonderful statistics service) you are giving full permission to Google to see and analyze the behavior of your users within your blog.

(see image on the right)

The percentage of bounce is specified in the start screen of Google Analytics, an indicator of the importance that this parameter has for Google no?

I do not want this article to motivate to uninstall Google Analytics … On the contrary, we must work to gain clicks on the links of our blog, reducing our bounce rate and climbing positions in the Google rankings 🙂

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you:

Unlimited search results

Normally the internal system of WordPress search only shows the results restricting itself to the structure of the "loop". But if you want unlimited search results without this restriction, you just have to make this little change …

1. You search for the file 'search.php' in your template, you'll find a code like this:

2. You replace the existing code with this one:

The number ' -1 ' indicates that the results are unlimited but, if you wish, you can put any number to decide your extension of those results. As always, you decide.

Searches without leaving the Editor • WordPress Help

Insights is perhaps one of the most useful plugins you can find in your blogger life. In fact can change your way of using WordPress turning the editor of your blog into an environment that you do not need to leave when it comes to adding relevant content.

What it offers you Insights is to be able to perform searches within the WordPress editor and once you found what you wanted to insert in your post, from the same interface.

And not everything remains there but for each functionality offers you options suitable to it . So, for example, in Flickr images you can choose the size of the images to be inserted; in the maps you can insert markers. An authentic joy . Even the way to insert videos is even easier than using the WordPress media manager.

WordPress Search – Use and Enjoy Guide • WordPress Help

You can do many things with the searches of a WordPress Blog . You can use the integrated search utility, replace it with Google or Yahoo or other searches or use plugins that add features to the searches.

But the important thing is that, before choosing any other system, understand and learn how WordPress internal searches work .

How WordPress Search works

When you search your blog the results are shown chronologically reverse (newest) first thing), not for the most related nor the most popular, not even alphabetically, just by date like the entries in your blog, but only shows those related to the object of your search. But the worst of all is that there is no way to know specifically in which of these entries is what you are looking for, simply you have to navigate through them, open them if they are not complete and try to locate what you were looking for.

Another of the failures that WordPress searches have is that only searches in the entries, they do not do it in the comments or in the pages only in the content of the entries.

] Another thing you should know, as administrator of the blog, is that the searches are based on the hierarchy of templates and, by default, first search through a file called search.php if it exists, and if it is not available, perform the search in the file index.php of the template.

This does not show the results the same depending on this hierarchy, even how and how personalized it is, if it existed, the arc hivo search.php . The most usual is that the index.php shows all the active content (images, videos, etc.) while search.php shows only the extracts which causes results to be obtained in a faster way.

There are templates that do not have a special search page a file search.php but this has an easy solution: you just have to copy the file of another template or make a copy of index.php and rename it as search.php . In principle you should not do more, WordPress would recognize it as the basis for searches and would use it for this purpose.

Surely, one of the most interesting modifications to make in this file would be to get not to show the full content but only the extracts . To do this you should search in search.php or index.php copied a line similar to this:

and replace it with this one:

But there are many more customizations available, check this page dell Codex to find and learn the ones that suit your needs or tastes.

How to change the WordPress Search

To replace the search function integrated in WordPress with a search engine function you must change with XHTML codes the existing function in PHP and located in the file [1945901] 7] searchform.php whose basic structure is somewhat similar to this:

This type of XHTML codes You can get them by registering in a search engine service and locate a code that offers you to include in your own website, such as codes to integrate Google search, then remember that it is ideal to adapt to the template of your blog so it would be advisable that you include this code on the page search.php of your template.


Of course, this article is informative, maybe somewhat instructive but on a daily basis today there are enough plugins, and good enough, that will allow you to change the WordPress search without having to use a code editor or modify any file. You just have to find one that suits your tastes and, in any case, adapt it a bit.

Thanks | Lorelle

NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you: