37. Disabling Specific Features | SEO Forge - Rank Higher with AI-Powered SEO
Download Log in

37. Disabling Specific Features

Developer Guide

SEO Forge is designed to work alongside other plugins. Each snippet below disables a single feature.

Disabling Meta Output

php
add_action( 'init', function () {
    if ( class_exists( 'SEOFORGE_Meta_Generator' ) ) {
        remove_action( 'wp_head', [ SEOFORGE_Meta_Generator::instance(), 'output_meta_tags' ], 1 );
    }
}, 20 );

Disabling Schema Output

php
add_action( 'init', function () {
    if ( class_exists( 'SEOFORGE_Schema' ) ) {
        remove_action( 'wp_head', [ SEOFORGE_Schema::instance(), 'output_schema' ], 5 );
    }
}, 20 );

Disabling Robots Meta

php
add_action( 'init', function () {
    if ( class_exists( 'SEOFORGE_Robots_Meta' ) ) {
        remove_action( 'wp_head', [ SEOFORGE_Robots_Meta::instance(), 'output_robots_meta' ], 2 );
    }
}, 20 );

Disabling Auto-Analysis on Save

php
add_action( 'init', function () {
    if ( class_exists( 'SEOFORGE_Analyzer' ) ) {
        remove_action( 'save_post', [ SEOFORGE_Analyzer::instance(), 'auto_analyze' ], 20 );
    }
}, 20 );

Disabling Image SEO

php
add_action( 'init', function () {
    if ( class_exists( 'SEOFORGE_Image_Seo' ) ) {
        $img = SEOFORGE_Image_Seo::instance();
        remove_action( 'add_attachment', [ $img, 'auto_alt_on_upload' ] );
        remove_filter( 'sanitize_file_name', [ $img, 'clean_filename' ], 10 );
    }
}, 20 );

Disabling All Front-End Output

Keep analysis and admin tools, but let another plugin handle all output:

php
add_action( 'init', function () {
    if ( ! class_exists( 'SEOFORGE_Core' ) ) { return; }

    if ( class_exists( 'SEOFORGE_Meta_Generator' ) )
        remove_action( 'wp_head', [ SEOFORGE_Meta_Generator::instance(), 'output_meta_tags' ], 1 );
    if ( class_exists( 'SEOFORGE_Robots_Meta' ) )
        remove_action( 'wp_head', [ SEOFORGE_Robots_Meta::instance(), 'output_robots_meta' ], 2 );
    if ( class_exists( 'SEOFORGE_Schema' ) )
        remove_action( 'wp_head', [ SEOFORGE_Schema::instance(), 'output_schema' ], 5 );
    if ( class_exists( 'SEOFORGE_Local_Seo' ) )
        remove_action( 'wp_head', [ SEOFORGE_Local_Seo::instance(), 'output_local_schema' ], 6 );
    if ( class_exists( 'SEOFORGE_Video_Seo' ) )
        remove_action( 'wp_head', [ SEOFORGE_Video_Seo::instance(), 'output_video_schema' ], 6 );
    if ( class_exists( 'SEOFORGE_AB_Testing' ) )
        remove_action( 'wp_head', [ SEOFORGE_AB_Testing::instance(), 'maybe_swap_meta' ], 0 );
    if ( class_exists( 'SEOFORGE_Sitemap' ) ) {
        $sitemap = SEOFORGE_Sitemap::instance();
        remove_action( 'init', [ $sitemap, 'register_rewrites' ] );
        remove_action( 'template_redirect', [ $sitemap, 'render_sitemap' ] );
    }
    if ( class_exists( 'SEOFORGE_Robots_Txt' ) )
        remove_filter( 'robots_txt', [ SEOFORGE_Robots_Txt::instance(), 'custom_robots_txt' ], 10 );
}, 20 );

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