Images not in sitemap(WPBakery)

#19982
  • Resolved marketing profin
    Rank Math free

    Team,

    Thanks for the plugin but the images not being indexed really bothers me.
    I found a case where it says you are working on a fix where images are not included in the sitemap when WPBakery Page Builder is used. Is there a fix already in place?

    Please assist. Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I have submitted this request to our dev team and we will be getting back to you in a short while.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    This needs to be addressed on their end and we emailed them with a fix a few months back.

    Can you please raise a support request with their team?

    Thank you.

    Tom Robak
    Rank Math business

    Hi Tom,

    Thanks for the great article 🙂


    @marketingprofinancial
    here is a copy of the fix from Tom’s article that you can include on your theme’s functions.php file:

    add_filter( 'rank_math/sitemap/urlimages', function( $images, $id ){
        if ( empty( $images ) ) {
            $post = get_post( $id );
            if ( $post && strpos( $post->post_content, '[vc_row' ) !== false ) {
                preg_match_all( '/(?:image|images|ids|include)\=\"([^\"]+)\"/', $post->post_content, $matches );
                foreach ( $matches[1] as $m ) {
                    $ids = explode( ',', $m );
                    foreach ( $ids as $id ) {
                        if ( (int) $id ) {
                            $images[] = array(
                                'src' => wp_get_attachment_url( $id ),
                                'title' => get_the_title( $id ),
                            );
                        }
                    }
                }
            }
        }
    
        return $images;
    }, 10, 2 );

    We are looking forward to helping you. Thank you.

    Hi Support Team!
    I have the same problem with sitemap and indexing images.. (using WPBakery).
    I’ve checked this solution from Tom’s article, but it still doesn’t work 🙁
    do you have any working solution for this problem?

    Hi Kamil,

    Thanks for the reply.

    Kindly get in touch with the guys from WPBakery so that they can help further.
    We have already email them about this and they should be able to address this from their end.

    I hope this info helps. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this ticket.