Change Featured image text in admin pages

If you are editing a theme or creating a new one, you probably need to work things around featured images. We have several articles which can help you with featured images. While you’re still editing this feature, why not create it even more personal and add custom text to it.

Change Featured image text in admin pages

If you have used, for example, a function which will automatically add featured image from a first image in a post, it would be nice to let your authors know what’s happening. You could simply change the text and use it as a short notification which will tell an author that featured image will be selected automatically if author hasn’t chosen one by himself. So, how to change that text which reads “Set featured image” to something else?

  1. Open functions.php file of the theme you’re using
  2. Copy and paste the following code:
  3. function change_featured_image_text( $content ) {
        return $content = str_replace( __( 'Set featured image' ), __( 'Your custom text goes here' ), $content);
    }
    add_filter( 'admin_post_thumbnail_html', 'change_featured_image_text' );
  4. Change the ‘Your custom text goes here’ but don’t forget to leave the single quotes
  5. Save changes
  6. Go to any post and see the changed text

    START YOUR OWN BLOG

    This guide is an introduction to mastering the art of blogging. It provides easy to follow steps to start, maintain, and grow your blog.

    Read the guide

    Leave a Reply

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