• Resolved tomas213

    (@tomas213)


    Hello!
    I searched the docs but i didn’t find any answer.
    Is there a way to bulk add many domains?
    Where are the domains stored ? in the db? in a file?
    Thank you!

    Thomas

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Gustavo Straube

    (@gustavostraube)

    Hello,

    There is no way to bulk add domains. I personally don’t see a real use case for that.

    The domains are stored using the WordPress’ Options API. At the end of the day, they’re stored into the database.

    Cheers!

    Thread Starter tomas213

    (@tomas213)

    Hello!
    Thanks for the really fast reply!
    I have 100 domains that i have to add, so i wanted to ask if there was a bulk way.
    Can you tell me in what table are the domains stores so i can see if i can make SQL query?

    Thank you.

    Thomas

    Plugin Contributor Gustavo Straube

    (@gustavostraube)

    Thomas,

    The plugin settings are stored under multiple-domain-domains option in the WordPress’ options table. That table is usually named wp_options. The value is stored as a serialized array. For a single domain (localhost:8080), it would look like this:

    a:1:{s:14:"localhost:8080";a:2:{s:4:"base";s:1:"/";s:4:"lang";s:5:"en-US";}}

    You can have a PHP code similar to the following to generate the option_value:

    $domains = [
        'localhost:8000' => [
            'base' => '/',
            'lang' => 'en-US',
        ],
    ];
    $option_value = serialize($domains);

    With the contents of $option_value you should be able to run the following SQL query:

    UPDATE wp_options SET option_value = '[OPTION_VALUE]' WHERE option_name = 'multiple-domain-domains';

    Just remember to replace the [OPTION_VALUE] with the actual serialized array.

    Let me know in case you have further questions.

    Thread Starter tomas213

    (@tomas213)

    Thank you very much!
    The details you provided is excellent !
    You should add the above in the faq too.
    Btw, the plugin is great and it’s working like a charm!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bulk insert domains’ is closed to new replies.