36. Database Tables | SEO Forge - Rank Higher with AI-Powered SEO
Download Log in

36. Database Tables

Developer Guide

SEO Forge uses two custom database tables.

wp_seoforge_analysis

sql
CREATE TABLE wp_seoforge_analysis (
    id               bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    post_id          bigint(20) unsigned NOT NULL,
    score            int(3) NOT NULL DEFAULT 0,
    issues           text DEFAULT '',
    suggestions      text DEFAULT '',
    meta_title       varchar(255) DEFAULT '',
    meta_description text DEFAULT '',
    schema_json      text DEFAULT '',
    internal_links   text DEFAULT '',
    analyzed_at      datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id),
    UNIQUE KEY post_id (post_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
php
// Get all posts with score below 50
global $wpdb;
$bad_posts = $wpdb->get_results(
    "SELECT a.post_id, a.score, p.post_title
     FROM {$wpdb->prefix}seoforge_analysis a
     JOIN {$wpdb->posts} p ON a.post_id = p.ID
     WHERE a.score < 50 AND p.post_status = 'publish'
     ORDER BY a.score ASC"
);

wp_seoforge_redirects

See section 22 for the full CREATE TABLE statement.

Transients

Transient KeyTTLDescription
seoforge_sitemap_index1 hourCached sitemap index XML
seoforge_sitemap_{posttype}1 hourPer-type sitemap XML
seoforge_video_sitemap1 hourVideo sitemap XML
seoforge_broken_links_cache1 dayBroken links results
seoforge_404_log1 week404 tracking log
seoforge_optimize_{post_id}1 hourContent optimization cache
php
// Clear all sitemap caches
SEOFORGE_Sitemap::instance()->invalidate_cache();

// Clear the 404 log
delete_transient( 'seoforge_404_log' );

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