Change the String "Search Results For"
|
/ Documentation /Custom Code Snippets/Astra Header & Footer Filters/ Change the String “Search Results For”

Change the String “Search Results For”

When you execute a search within a website using Astra’s search option, you can see a similar layout as below. In case you wish to alter the default string – ” Search Results For “, use the code mentioned below.

Default Search Result String with Astra

Note: Add the following code in the 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>' );
}
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page

Download is Just A Click Away!

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

This field is required.

REWIND

YEAR IN REVIEW

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