No results found. Try again with different words?

Search must be at least 3 characters.

How to Change the “Search Results For” String

Sidebar Image

Did not find a solution? We are here to help you succeed.

If you’re using Astra’s search option on a website and want to change the default string “Search Results For,” you’re in luck! This article will guide you through the process.

To modify the above string, add the following code to your child theme’s functions.php file.

add_filter( 'astra_the_search_page_title', 'my_function', 10 ); 

function my_function() {
    return sprintf( __( 'Add Custom Text Here: %s', 'astra' ), '<span>' . get_search_query() . '</span>' );
}

Here’s how you can do it:

Navigate to Appearance > Theme File Editor, and access the functions.php file.

Paste the above code here and click on the Update File button.

Verify these changes on your website.

That’s it! The text inside “return sprintf( __( ‘Add Custom Text Here: %s’, ‘astra’ )” in the code can be replaced according to your preferred text.

If you face any issues with the above, please reach out to our support team.

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Download is Just A Click Away!

Membership Retention Checklist Download

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form