ADAMS_Project_Logo-SVG-Multi
ADAMS_Project_Tutorials_Remove_Search_Results_For_Feature

How to Remove or Edit Search Results for in WordPress

According to WIPO (World Intellectual Property Organization), Intellectual Property refers to the creation and labor of the mind, including its fruition. It could be inventions, artistic and literary works, symbols, names, images and designs used in commerce. So, when someone came up with an epic or novel artistic creations, it can be protected in various ways and in many levels. This can be Patents, Trademarks or Copyright. But what are they exactly and how are they any different?

Have you ever tried designing a WordPress website and enjoyed its flexibility, only to encounter a hurdle where elements persist stubbornly, even when you don’t need them? Well, this is a classic example of the challenges faced with modular website builders, such as WordPress, and more specifically, the well-known theme builder, Elementor Pro.

It’s all about the pre-text in search results: “Search Results For,” followed by the custom keyword entered by the user in the search bar. A seasoned WordPress designer using Elementor Pro is well aware of this. The user clicks on the search icon, enters a keyword on the website, such as “Computer” in this example, and then hits enter. The search result appears as follows:

ADAMS_Project_Tutorials_Remove_Search_Results_For_Result

Now, the problem with this pre-text “Search Results for” is that it is not editable nor removable. It will be there even if you don’t need it or want to edit it. Except maybe if you use special code to remove or edit it. Or a feature will be available in later times to edit it out.

As WordPress designer, we all want the freedom to turn things around the way we wanted it – aesthetically or functionally.

So, in this tutorial we’ll learn how to edit or remove the search results pre-text and design your search results page at will and the way you wanted it.

Note: This tutorial presumes that at least you have a working knowledge of WordPress and Elementor Pro. Also, this assumes that you have already setup your Search Results Archive Page. If you did not setup it yet, learn from here.

ADAMS_Project_Tutorials_Remove_Search_Results_For_Redundant

If you notice, the line “Search Results for:” is still there despite editing it out. It has already been redundant as I already have that text above it.

No worries, we’ll remove those texts. Carry on with the steps…

				
					/*Remove "Search Results for:"*/

add_filter( 'elementor/utils/get_the_archive_title','archive_callback' );
function archive_callback( $title ) {
 if ( is_search() ) { 
   return 'Hey, your search results for:' . get_search_query() ; 
 } 
   return $title; 
}
				
			
ADAMS_Project_Tutorials_Remove_Search_Results_For_Pasted_Edited

Head back to your website’s front-end and do a search.

Notice that the pre-text “Search Results for:” is no longer there.

Note: This tutorials has some variability in it. This may work or may not for you depending on your system setup, versions and applications. So check out for yourself. WordPress is dynamically updating the system, this is one thing you need to check as well.

Enjoy!

SHARE

RELATED POSTS

ADAMS_Project_Tutorials_How_To_Super_High_Resolution_Search_Google_Feature

How to Do Super High Resolution Image Search with Google

Gone are the days where you can still deliberately narrow up your image size search with Google. Today, image size searches have been singled-out by Google into just Any Size, Large, Medium and Icon. There will be no way for you to input image size numerically.

Read More
ADAMS_Project_Tutorials_How_To_Create_WordPress_Admin_With_phpMyAdmin_Feature

How to Create WordPress Admin User Using phpMyAdmin

This is one major dilemma of a WordPress designer who inherits a WordPress website without proper documentation and turnover. More often WordPress and Host credentials work but sometimes either or won’t work. In this case it’s the WordPress Admin User that failed to work. But fortunately, you have the hosting credentials working for you.

Read More

COMMENTS

Leave a Reply

Your email address will not be published. Required fields are marked *