WordPress.org

Ready to get started?Download WordPress

Forums

Custom Sidebars
[resolved] Can you export and import Custom Sidebars? (6 posts)

  1. smellcoffee
    Member
    Posted 2 months ago #

    I am migrating to a new host. Everything migrated over pretty well to the staging area. However my custom-sidebars have all been reset.

    Is there a way to export/import the sidebar settings so I don't have to manually re-build my sidebars from scratch? I still have the site live on the other host with my original Custom Sidebars intact.
    .... I have a pretty large site with 19 Custom Sidebars setup.

    Thanks for the great work!

    https://wordpress.org/plugins/custom-sidebars/

  2. WPMU DEV
    Member
    Posted 2 months ago #

    Hi @smellcoffee,

    I hope you are well today and thank you for your question.

    You can export your custom sidebars settings by exporting the .sql file from your old WordPress database selecting "cs_sidebars" and "cs_modifiable" options from the wp_options table where wp_ is a WordPress table prefix.

    Import the custom sidebars settings by importing this generated sql file containing "cs_sidebars" and "cs_modifiable" options in your new WordPress database.

    To import / export widgets from your old site to new site try using the following plugin.

    https://wordpress.org/plugins/widget-importer-exporter/

    Best Regards,
    WPMU DEV

  3. smellcoffee
    Member
    Posted 2 months ago #

    Hi @WPMU DEV

    Yeah!

    Thank you for the how-to.
    I'll give it a go.

  4. WPMU DEV
    Member
    Posted 2 months ago #

    You are most welcome, if I can be of any further assistance please don't hesitate to ask :)

  5. florty
    Member
    Posted 2 months ago #

    Hi @WPMU DEV
    I´m trying to do the same thing, but when importing the sql file into my new wordpress database, I get the error message: #1050 - Table 'wp_options' already exists. I didn´t change anything in the settings while exporting/importing.
    I hope you can help me out with this.
    Thanks,
    Floortje

  6. WPMU DEV
    Member
    Posted 2 months ago #

    Hi Floortje,

    Thanks for posting on the forums.

    I think you are exporting and importing whole wp_options table, you don't need to export/ import whole wp_options table for exporting / importing custom sidebars settings.

    To import / export only the Custom Sidebars settings execute the following sql query in your PHPMyAdmin sql executer.

    SELECT * FROM<code>wp_options</code>WHERE option_name = "cs_sidebars" or option_name = "cs_modifiable";

    Then on the generated results page select all the two found rows by clicking on the "Check All" text and export it by clicking on the "Export" text as described in the following reply.

    http://serverfault.com/a/300342

    If by any chance according to the configuration of your PHPMyAdmin the exported sql file contains the wp_options table creation code as following

    CREATE TABLE 'wp_options' (

    then before importing just change the above code in the generated sql file as below so that when importing it won't generate "Table 'wp_options' already exists" error message

    CREATE TABLE IF NOT EXISTS 'wp_options' (

    Cheers,
    WPMU DEV

Reply

You must log in to post.

About this Plugin

About this Topic

Tags