Search code examples
wordpresspost-meta

How do I remove text "by" and " | " from post meta in Divi?


I want to remove these highlighted texts from meta section


Solution

  • please go to Divi >includes > builder > functions.php file and you can find the code there.

     if ( ! function_exists( 'et_pb_postinfo_meta' ) ) :
    function et_pb_postinfo_meta( $postinfo, $date_format, $comment_zero, $comment_one, $comment_more ){
        $postinfo_meta = '';
    
        if ( in_array( 'author', $postinfo ) )
            $postinfo_meta .= ' ' . esc_html__( 'by', 'et_builder' ) . ' <span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>';
    
        if ( in_array( 'date', $postinfo ) ) {
            if ( in_array( 'author', $postinfo ) ) $postinfo_meta .= ' | ';
            $postinfo_meta .= '<span class="published">' . esc_html( get_the_time( wp_unslash( $date_format ) ) ) . '</span>';
        }
    

    Remove by and | from here > save and check.