Back to Community

How to Import Redux Framework Options with One Click Demo Import

15 threads Sep 9, 2025 PluginOne click demo import

Content

Many WordPress theme developers use the Redux Framework to power their theme options panels. A common challenge arises when trying to import these settings as part of a full demo site installation with the popular One Click Demo Import (OCDI) plugin. This guide explains the issue and provides the most effective solutions.

Why Redux Options Aren't Imported by Default

Historically, the core OCDI plugin did not natively support importing Redux Framework options. This was a frequent point of confusion, as users could successfully import content, widgets, and Customizer data but found their theme options remained unchanged. The Redux Framework team suggests importing options directly through its own interface, which is why a direct integration was not initially part of OCDI.

Official Redux Support in OCDI

Good news! Due to significant community feedback, native support for the Redux Framework was added in a major update to the One Click Demo Import plugin (version 2.0.0 and above). If your theme is configured to use OCDI's standard import file structure, the Redux options should import automatically alongside all other demo data.

Manual Solutions and Workarounds

If you are using an older version of OCDI, a theme that hasn't implemented the new standard, or another options framework like CodeStar, you will need to use a manual workaround. The most common and powerful method is to use the ocdi/after_import hook. This allows you to execute custom PHP code immediately after the standard import process finishes.

Method 1: Using the after_import Hook (For Redux or Other Frameworks)

You can add the following code to your theme's functions.php file. This example is for Redux but can be adapted for other frameworks by changing the option name and file path.

function my_theme_after_import_setup() {
    // Path to your Redux JSON file within your theme
    $redux_options_file = get_template_directory() . '/demo-data/redux_options.json';

    if ( file_exists( $redux_options_file ) ) {
        // Get the contents of the file and decode it
        $redux_options_data = json_decode( file_get_contents( $redux_options_file ), true );

        // Update the WordPress option with the imported data.
        // Replace 'your_theme_option_name' with your actual Redux option name.
        update_option( 'your_theme_option_name', $redux_options_data );
    }
}
add_action( 'ocdi/after_import', 'my_theme_after_import_setup' );

Method 2: Using WP-CLI (For Advanced Users)

For developers comfortable with the command line, WP-CLI provides a direct method to import Redux options stored in a JSON file. This is useful for automation or deployment scripts.

wp option update your_theme_option_name --format=json < path/to/your/redux-file-import.json

Replace your_theme_option_name with the actual name of the Redux option stored in your WordPress database.

Troubleshooting a Common Error

Some users have reported a PHP deprecated notice related to set_options after an import. This issue was identified and resolved by the One Click Demo Import team. If you encounter this, ensure your OCDI plugin is updated to the latest version to apply the fix.

Conclusion

Importing theme options from the Redux Framework or other custom option panels is now more straightforward than ever. Always ensure your OCDI plugin is updated to benefit from native Redux support. For other frameworks or custom implementations, the ocdi/after_import hook offers a flexible and reliable solution to complete your one-click demo import process.

Related Support Threads Support