Support Log in

48. Migration from AIOSEO

Developer Guide
Prefer video? Watch the Rank Forge tutorials 9 short guides covering every feature Watch

All-in-One SEO (AIOSEO) migration is also supported by the built-in tool.

What Gets Migrated

AIOSEO stores data in a custom aioseo_posts table:

AIOSEO ColumnRank Forge Meta Key
title_rankforge_meta_title
description_rankforge_meta_description
keyphrases (JSON, primary)_rankforge_focus_keyword
robots_noindex_rankforge_noindex
robots_nofollow_rankforge_nofollow
canonical_url_rankforge_canonical_url
og_title_rankforge_og_title
og_description_rankforge_og_description
og_image_url / og_image_custom_url_rankforge_og_image
twitter_title_rankforge_twitter_title
twitter_description_rankforge_twitter_description

AIOSEO custom canonical URLs (canonical_url) are imported into _rankforge_canonical_url. AIOSEO v4 rows with no supported payload are skipped by both detection and migration, so the UI count matches the migrated count.

Manual AIOSEO Migration

php
global $wpdb;

// Check if AIOSEO table exists
$table = $wpdb->prefix . 'aioseo_posts';
$exists = $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $table ) );

if ( $exists ) {
    $rows = $wpdb->get_results(
        "SELECT * FROM {$table}
         WHERE title != ''
            OR description != ''
            OR keyphrases != ''
            OR robots_noindex = 1
            OR robots_nofollow = 1
            OR canonical_url != ''
            OR og_title != ''
            OR og_description != ''
            OR twitter_title != ''
            OR twitter_description != ''"
    );

    foreach ( $rows as $row ) {
        $post_id = $row->post_id;

        if ( ! empty( $row->title ) ) {
            $title = str_replace(
                [ '#post_title', '#site_title', '#separator_sa' ],
                [ get_the_title( $post_id ), get_bloginfo( 'name' ), '|' ],
                $row->title
            );
            update_post_meta( $post_id, '_rankforge_meta_title', sanitize_text_field( $title ) );
        }

        if ( ! empty( $row->description ) ) {
            $desc = str_replace(
                [ '#post_title', '#post_excerpt', '#site_title' ],
                [ get_the_title( $post_id ), get_the_excerpt( $post_id ), get_bloginfo( 'name' ) ],
                $row->description
            );
            update_post_meta( $post_id, '_rankforge_meta_description', sanitize_text_field( $desc ) );
        }

        // Extract primary keyphrase from JSON
        if ( ! empty( $row->keyphrases ) ) {
            $kp = json_decode( $row->keyphrases, true );
            $primary = $kp['focus']['keyphrase'] ?? '';
            if ( $primary ) {
                update_post_meta( $post_id, '_rankforge_focus_keyword', sanitize_text_field( $primary ) );
            }
        }

        if ( ! empty( $row->robots_noindex ) ) {
            update_post_meta( $post_id, '_rankforge_noindex', '1' );
        }
        if ( ! empty( $row->robots_nofollow ) ) {
            update_post_meta( $post_id, '_rankforge_nofollow', '1' );
        }
    }
}

Forge AI Assistant Online

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

Just now
Powered by Forge AI · Browse docs