40. Debugging SEO Issues | SEO Forge - Rank Higher with AI-Powered SEO
Download Log in

40. Debugging SEO Issues

Developer Guide

Techniques for diagnosing and resolving common SEO problems in SEO Forge.

Checking Meta Output

View the raw HTML output to verify meta tags are rendering correctly:

bash
curl -s https://example.com/my-post/ | grep -i '<meta'
curl -s https://example.com/my-post/ | grep -i 'application/ld+json'

Verifying Schema JSON-LD

php
// In a custom admin page or WP-CLI script
$post_id = 42;
$schema  = SEOFORGE_Schema::instance();
$output  = $schema->generate( $post_id, 'Article' );

echo '<pre>' . esc_html( wp_json_encode( $output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ) . '</pre>';

// Validate with Google's Rich Results Test
echo 'Validate: https://search.google.com/test/rich-results?url=' . urlencode( get_permalink( $post_id ) );

Diagnosing Score Discrepancies

php
$post_id  = 42;
$analyzer = SEOFORGE_Analyzer::instance();

// Force fresh analysis (ignores cache)
$fresh = $analyzer->analyze( $post_id );

// Read the cached version
$cached = $analyzer->get_cached( $post_id );

echo "Fresh score: {$fresh['score']}n";
echo "Cached score: {$cached->score}n";
echo "Issues:n";
foreach ( $fresh['issues'] as $issue ) {
    echo "  [{$issue['severity']}] {$issue['message']} (-{$issue['deduction']})n";
}

Checking Redirect Execution

php
// Test if a URL has a matching redirect
global $wpdb;
$source = 'old-page';
$redirect = $wpdb->get_row(
    $wpdb->prepare(
        "SELECT * FROM {$wpdb->prefix}seoforge_redirects WHERE source_url = %s",
        $source
    )
);

if ( $redirect ) {
    echo "Redirect found: {$redirect->source_url} -> {$redirect->target_url} ({$redirect->redirect_type})n";
    echo "Hits: {$redirect->hits}, Last hit: {$redirect->last_hit}n";
} else {
    echo "No redirect found for: {$source}n";
}

Verifying Sitemap Contents

bash
curl -s https://example.com/sitemap_index.xml
curl -s https://example.com/post-sitemap.xml | head -50
curl -s https://example.com/video-sitemap.xml

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