No results found. Try again with different words?

Search must be at least 3 characters.

How to Change the Default Astra Strings

Sidebar Image

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

By leveraging the astra_default_strings filter, you can effortlessly alter the default text displayed by Astra to better suit your needs.

You will have to add these to your child theme’s functions.php file for it to work. Check out this doc that explains how to add custom PHP code using the child theme’s functions.php file. 

Usage

// Filter callback function
function example_callback( $strings ) {
    # ...
    return $strings;
}
add_filter( 'astra_default_strings', 'example_callback', 10 );

Parameters

The following section describes some parameters and their filters that you can try out for your website.

  • To change the 404 sub-title
function default_strings_callback( $strings ) {
    // Search nothing found string
    $strings['string-404-sub-title']	= __( 'This page doesn't seem to exist.', 'astra' );
    return $strings;
}
add_filter( 'astra_default_strings', 'default_strings_callback', 10 );
  • To change the 404 search title
add_filter('astra_the_404_page_title' , 'page_notfound_callback');
function page_notfound_callback( ){
$modified_text = esc_html__( 'This is a custom message', 'astra' );
return $modified_text;
}
  • Search Page Strings: Modify various strings related to the search functionality using the provided filters.
$strings['string-search-nothing-found']		   = __( 'Nothing Found', 'astra' );
$strings['string-search-nothing-found-message']	   = __( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'astra' );
$strings['string-full-width-search-message']	   = __( 'Start typing and press enter to search', 'astra' );
$strings['string-full-width-search-placeholder']   = __( 'Start Typing...', 'astra' );
$strings['string-header-cover-search-placeholder'] = __( 'Start Typing...', 'astra' );
$strings['string-search-input-placeholder']	   = __( 'Search ...', 'astra' );
  • Comment Template Strings: Customize strings related to commenting functionality to better fit your website’s tone and style.
$strings['string-comment-reply-link']		= __( 'REPLY', 'astra' );
$strings['string-comment-edit-link']		= __( 'EDIT', 'astra' );
$strings['string-comment-awaiting-moderation']	= __( 'Your comment is awaiting moderation.', 'astra' );
$strings['string-comment-title-reply']		= __( 'Leave Comment', 'astra' );
$strings['string-comment-cancel-reply-link']	= __( 'Cancel Reply', 'astra' );
$strings['string-comment-label-submit']		= __( 'Post Comment →', 'astra' );
$strings['string-comment-label-message']	= __( 'Message', 'astra' );
$strings['string-comment-label-name']		= __( 'Name*', 'astra' );
$strings['string-comment-label-email']		= __( 'Email*', 'astra' );
$strings['string-comment-label-website']	= __( 'Website', 'astra' );
$strings['string-comment-closed']		= __( 'Comments are closed.', 'astra' );
$strings['string-comment-navigation-title']	= __( 'Comment navigation', 'astra' );
$strings['string-comment-navigation-next']	= __( 'Newer Comments', 'astra' );
$strings['string-comment-navigation-previous']	= __( 'Older Comments', 'astra' );
$strings['string-comment-one-comment']		= __( 'ONE COMMENT', 'astra' );
$strings['string-comment-multiple-comment']	= __( '%1$s COMMENTS', 'astra' );
  • Blog Default Strings: Adjust default strings associated with blog pages.
$strings['string-blog-page-links-before']	= __( 'Pages:', 'astra' );
$strings['string-blog-meta-author-by']		= __( 'By ', 'astra' );
$strings['string-blog-meta-leave-a-comment']	= __( 'Leave a comment', 'astra' );
$strings['string-blog-meta-one-comment']	= __( '1 Comment', 'astra' );
$strings['string-blog-meta-multiple-comment']	= __( '% Comments', 'astra' );
$strings['string-blog-navigation-next']		= __('Next Page', 'astra') . ' ';
$strings['string-blog-navigation-previous']	= ' ' . __('Previous Page', 'astra');
  • Single Post Default Strings: Modify default strings specific to single post pages.
$strings['string-single-page-links-before']	= __( 'Pages:', 'astra' );
$strings['string-single-navigation-next']	= __('Next Post', 'astra') . ' ';
$strings['string-single-navigation-previous']	= ' ' . __('Previous Post', 'astra');
  • Content None: Customize the message displayed when no content is found.
$strings['string-content-nothing-found-message'] = __( 'It seems we can't find what you're looking for. Perhaps searching can help.', 'astra' );

Example

You can see this example that we’ve created:

/**
 * Update Search Nothing Found String and Search Input Box Placeholder Strings
 *
 * @param array $strings     List of default strings used in theme
 * @return array $strings
 */
function default_strings_callback( $strings ) {
    // Search nothing found string
    $strings['string-search-nothing-found-message']	= __( 'Sorry, There is no Search Result found.', 'astra' );
    // Search input box placeholder
    $strings['string-search-input-placeholder']	= __( 'Search ...', 'astra' );
    return $strings;
}
add_filter( 'astra_default_strings', 'default_strings_callback', 10 );

Please contact our support team if you face any issues while integrating these codes. We’re always here to help!

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