5. Video Meta Fields | SEO Forge - Rank Higher with AI-Powered SEO
Download Log in

5. Video Meta Fields

Developer Guide

Video-related post meta for VideoObject schema and video sitemap. PRO feature.

Meta KeyTypeDescription
_seoforge_videosstring (JSON)Auto-detected videos array. Populated automatically on save_post.
_seoforge_video_urlstringManual video URL override. Takes priority over auto-detected videos.
_seoforge_video_thumbnailstringManual thumbnail URL for the video.
_seoforge_video_durationstringDuration in ISO 8601 format (e.g. PT5M30S for 5 minutes 30 seconds).
_seoforge_video_descriptionstringVideo description used in VideoObject schema and video sitemap.
php
// ----- Reading video meta -----

$post_id = 42;

$videos_json = get_post_meta( $post_id, '_seoforge_videos', true );
$videos = $videos_json ? json_decode( $videos_json, true ) : [];
// Each video: [ 'platform' => 'youtube', 'id' => 'dQw4w9WgXcQ', 'url' => '...', 'embed_url' => '...', 'thumbnail' => '...' ]

$manual_url   = get_post_meta( $post_id, '_seoforge_video_url', true );
$thumbnail    = get_post_meta( $post_id, '_seoforge_video_thumbnail', true );
$duration     = get_post_meta( $post_id, '_seoforge_video_duration', true );
$description  = get_post_meta( $post_id, '_seoforge_video_description', true );
php
// ----- Writing video meta -----

$post_id = 42;

update_post_meta( $post_id, '_seoforge_video_url', 'https://www.youtube.com/watch?v=abc123' );
update_post_meta( $post_id, '_seoforge_video_thumbnail', 'https://example.com/thumbnails/video-abc123.jpg' );
update_post_meta( $post_id, '_seoforge_video_duration', 'PT10M15S' );
update_post_meta( $post_id, '_seoforge_video_description', 'A comprehensive tutorial on WordPress SEO.' );

// Remove manual video override (fall back to auto-detected)
delete_post_meta( $post_id, '_seoforge_video_url' );

// Force re-detection of videos in post content
SEOFORGE_Video_Seo::instance()->auto_detect_videos( $post_id, get_post( $post_id ) );

Taxonomy Term Meta

SEO Forge supports noindex and nofollow on taxonomy terms (categories, tags, and custom taxonomies):

php
$term_id = 15;

// Mark category archive as noindex
update_term_meta( $term_id, '_seoforge_noindex', '1' );
update_term_meta( $term_id, '_seoforge_nofollow', '1' );

// Read values
$is_noindex  = get_term_meta( $term_id, '_seoforge_noindex', true ) === '1';

// Bulk noindex all empty categories
$categories = get_categories( [ 'hide_empty' => false ] );
foreach ( $categories as $cat ) {
    if ( $cat->count === 0 ) {
        update_term_meta( $cat->term_id, '_seoforge_noindex', '1' );
    }
}

Forge AI Assistant Online

Hi! I'm the SEO Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs