Hello everyone, i am not able to fix this issue in the Search Console Video is not the main content of the page but actually it is!

When you enter in my product page the first thing that appears is the video it self! (hosted on imgur platform)

I even added additional Schema video tags but that seems is useless.

here is the code i am using:

P.S: $image4 variable sometimes can contain video link or image link.

<?php if (!empty($image4)): ?>
    <div class="swiper-slide">
        <div class="dz-media" itemscope itemtype="http://schema.org/VideoObject">
            <?php
            if (pathinfo($image4, PATHINFO_EXTENSION) === 'mp4') {
                // Display a video if the link points to an MP4 file
                echo '<meta itemprop="thumbnailUrl" content="' . $image1 . '">';
                echo '<meta itemprop="contentUrl" content="' . $image4 . '">';
                echo '<video controls width="100%" height="auto" poster="' . $image1 . '" itemprop="video">';
                echo '<source src="' . $image4 . '" type="video/mp4">';
                echo 'Your browser does not support the video tag.';
                echo '</video>';
            } elseif (in_array(pathinfo($image4, PATHINFO_EXTENSION), array('png', 'jpg', 'jpeg'))) {
                // Display an image if the link points to a PNG, JPG, or JPEG file
                echo '<img src="' . $image4 . '" alt="' . $product_tags . '">';
            }
            ?>
            <meta itemprop="name" content="<?php echo htmlspecialchars($product_name); ?>">
            <meta itemprop="description" content="<?php echo htmlspecialchars($product_description); ?>">
            <meta itemprop="uploadDate" content="<?php echo date('c', strtotime($upload_date)); ?>">
        </div>
    </div>
<?php endif; ?>

please anyone with the knowledge how to fix this problem

here is a link to a product page on my website
https://www.kupisi.mk/product/за-дома/сунгер-за-чистење-прашина/48

@Dani please remove the backlinks if possible, so my site doesn't get indexed :D

BUMP. Anyone can help with this issue ? :/

I’ll take a look at this tomorrow. I’m currently in bed :)

You have the itemtype set to a VideoObject but, as you point out, only sometimes is there actually an .mp4 file. The rest of the time, it's a static image such as a png, jpg, or jpeg. Google probably doesn't trust your meta tags since they are inaccurate half the time.

But i am generating the JSON code dynamically. If there is no video than i hide the VideoObject tag with if statement.
Should i just remove the itemscope itemtype="http://schema.org/VideoObject"

commented: Yes, exactly +34

Yes, if the page does not contain video content, then remove itemscope itemtype="http://schema.org/VideoObject"

I'm so sorry for not responding sooner. I just saw your post now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.