How To Change Astra Theme Default Text

As part of making your site feel more like your own, you might want to change some of the default text that the WordPress Astra theme adds.

Common things I'm often asked to change are:

  • Leave a Comment
  • Your comment is awaiting moderation
  • Sorry, but nothing matched your search terms. Please try again with some different keywords.

Astra makes it easy to modify all these, if you know where to look.

To change the default text in Astra, add a filter to 'astra_default_strings', passing in the $defaults array. Change any of the text you want by the array key and return the array.

Arrow pointing to Leave Feedback on Astra post meta

By way of example, let's change the "Leave a Comment" text to "Leave Feedback".

add_filter( 'astra_default_strings', 'iw_blog_comment' );

function iw_blog_comment( $defaults ) {
  $defaults['string-blog-meta-leave-a-comment'] = 'Leave Feedback';
  return $defaults;
}

Add a new line for each change you want to make. You could also add conditionals if you wanted to change the text on certain pages.

To change text other than the "Leave a Comment", replace string-blog-meta-leave-a-comment in the code above with the key from the table below.

Then change Leave Feedback to whatever you want the default text to say.

Make sure to wrap your text in quotes (single or double, whichever you prefer) and return the changed array of $defaults.

List of Astra Default Text

Below is the list of default text and corresponding keys for Astra as of version 3.6.2. It's unlikely to change, but it may over time, or they may add to it.

If you want to find the list current to your version, look under /astra/inc/core/class-theme-strings.php.

KeyDefault Text
string-header-skip-linkSkip to content
string-404-sub-titleIt looks like the link pointing here was faulty. Maybe try searching?
string-search-nothing-foundNothing Found
string-search-nothing-found-messageSorry, but nothing matched your search terms. Please try again with some different keywords.
string-full-width-search-messageStart typing and press enter to search
string-full-width-search-placeholderStart Typing…
string-header-cover-search-placeholderStart Typing…
string-search-input-placeholderSearch …
string-comment-reply-linkReply
string-comment-edit-linkEdit
string-comment-awaiting-moderationYour comment is awaiting moderation.
string-comment-title-replyLeave a Comment
string-comment-cancel-reply-linkCancel Reply
string-comment-label-submitPost Comment »
string-comment-label-messageType here..
string-comment-label-nameName*
string-comment-label-emailEmail*
string-comment-label-websiteWebsite
string-comment-closedComments are closed.
string-comment-navigation-titleComment navigation
string-comment-navigation-nextNewer Comments
string-comment-navigation-previousOlder Comments
string-blog-page-links-beforePages:
string-blog-meta-author-byBy
string-blog-meta-leave-a-commentLeave a Comment
string-blog-meta-one-comment1 Comment
string-blog-meta-multiple-comment% Comments
string-blog-navigation-nextNext Page
string-blog-navigation-previous Previous Page
string-single-page-links-beforePages:
string-single-navigation-nextNext %s
string-single-navigation-previous Previous %s
string-content-nothing-found-messageIt seems we can’t find what you’re looking for. Perhaps searching can help.
Mike Haydon

Thanks for checking out my WordPress and coding tutorials. If you've found these tutorials useful, why not consider supporting my work?

Buy me a coffee

Leave a Comment