How to change the text 'by' from the post meta in the WordPress Divi Theme

In some languages, the text 'by' from the post meta might have been translated unnaturally in the WordPress Divi theme by Elegant Themes. You might want to translate the string 'by' by yourself. Or some might want to remove it. You can change the text 'by' form the post meta using jQuery or by editing the theme files.

WordPress Theme Divi by Elegant Themes - the most popular WordPress theme

How to change the text 'by' from the post meta in the WordPress Divi Theme

How to change the text 'by' from the post meta in the WordPress Divi Theme

If you want to replace the text 'by' from 'by author' in Divi, please add the following custom code sunder Divi > Theme Options > Integration > 'Header' area.

<script> (function($) { $(document).ready(function() { var post = $('.et_pb_post'); if ( post.length ) { post.each(function(){ var post_meta = post.find('.post-meta'); post_meta.html( post_meta.html().replace("by ", "INSERT YOUR TEXT HERE") ); }); }             }); })(jQuery); </script>

Just replace the line that says "INSERT YOUR TEXT HERE" with your own preferred text. To remove 'by', you can just replace it with a space (that is " " in place of "INSERT YOUR TEXT HERE").

Just for your reference, this string 'by author' is found in the your language file (.mo file) under the /wp-content/themes/Divi/includes/builder/languages/ folder.

You might want to edit the theme files to replace the string 'by' from the post meta with your own preferred text. In this case, you can edit funtions.php under the /wp-content/themes/Divi/includes/builder/ directory. Please find the following lines.

if ( in_array( 'author', $postinfo ) ) {
			$postinfo_meta[] = ' ' . esc_html__( 'by', 'et_builder' ) . ' <span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>';
		}

You can just edit the above lines as you wish.

However, this method is not desirable because the edits will disappear after you update your theme.

See Also...


3s