X
    Categories: Tutorials

WordPress: How to change the Excerpt box label & description

Sometimes you want to change default WordPress labels and descriptions so they’re a bit more tailed towards your site. One of the sites I work on is a news site and writers were getting confused as to exactly what an excerpt is, how long it should be and what it should consist of. To combat we the problem we simply changed the description label on the excerpt box in the WordPress admin. Voilà, problem sorted.

Changing the Excerpt Label and Description

Add the following code to your theme’s functions.php file. Be sure to change the translated text to whatever you wish your excerpt label and description to say.

function wpartisan_excerpt_label( $translation, $original ) {
	if ( 'Excerpt' == $original ) {
		return __( 'My Custom Excerpt Label' );
	} elseif ( false !== strpos( $original, 'Excerpts are optional hand-crafted summaries of your' ) ) {
		return __( 'My Custom Excerpt Description' );
	}
	return $translation;
}
add_filter( 'gettext', 'wpartisan_excerpt_label', 10, 2 );

And this is the result:

Edward :