{"id":4243,"date":"2016-06-01T12:59:44","date_gmt":"2016-06-01T12:59:44","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=4243"},"modified":"2016-06-01T12:59:44","modified_gmt":"2016-06-01T12:59:44","slug":"wordpress-exporting-settings-plugin","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/","title":{"rendered":"WordPress: Exporting Settings for a plugin"},"content":{"rendered":"<p>Since every WordPress plugin runs custom PHP code, it can write to the filesystem, your database, and potentially remote storage (e.g. if you use a DropBox backup plugin). In this example I&#8217;m going to show how to export settings for iThemes security, since this has a moderately complex installation.<\/p>\n<p>To see what this look like, you can log into your database and list out the tables:<\/p>\n<pre lang=\"sql\">\nmysql -u root -p\nselect garysielingcom;\nshow tables;\n<\/pre>\n<pre>\n+---------------------------+\n| Tables_in_garysielingcom  |\n+---------------------------+\n| wp_appsin_settings        |\n| wp_commentmeta            |\n| wp_comments               |\n| wp_cpd_counter            |\n| wp_easy_todo              |\n| wp_itsec_lockouts         |\n| wp_itsec_log              |\n| wp_itsec_temp             |\n| wp_layerslider            |\n| wp_links                  |\n| wp_nf_objectmeta          |\n| wp_nf_objects             |\n| wp_nf_relationships       |\n| wp_ninja_forms_fav_fields |\n| wp_ninja_forms_fields     |\n| wp_options                |\n| wp_popularpostsdata       |\n| wp_popularpostssummary    |\n| wp_postmeta               |\n| wp_posts                  |\n| wp_term_relationships     |\n| wp_term_taxonomy          |\n| wp_termmeta               |\n| wp_terms                  |\n| wp_usermeta               |\n| wp_users                  |\n| wp_wsal_metadata          |\n| wp_wsal_occurrences       |\n+---------------------------+\n<\/pre>\n<p>Some of these are obviously WordPress tables (wp_posts, wp_users, etc), but several are for plugins I&#8217;ve installed (e.g. WP Security has several &#8211; wp_itsec_lockouts, wp_itsec_log, and wp_itsec_temp). The &#8220;wp_&#8221; part of the table name is configured at install time &#8211; if you have multiple WordPress installs in a database they would have different prefixes. This indicates that WordPress plugins with this prefix are using a WordPress API to set the table up.<\/p>\n<p>Consequently, if you want to see where these are created, you need to search your site for the table name without the prefix:<\/p>\n<pre lang=\"bash\">\ngrep -irl itsec_temp *    \n<\/pre>\n<pre>\nwp-content\/plugins\/better-wp-security\/core\/class-itsec-setup.php\nwp-content\/plugins\/better-wp-security\/core\/class-itsec-lockout.php\nwp-content\/plugins\/better-wp-security\/core\/modules\/backup\/settings.php\nwp-content\/plugins\/better-wp-security\/core\/class-itsec-lib.php\n<\/pre>\n<p>To export one of these tables, you can use &#8220;mysqldump&#8221;, like so:<\/p>\n<pre lang=\"bash\">\nmysqldump -p garysielingcom wp_itsec_lockouts > wp_itsec_lockouts.sql\n<\/pre>\n<p>When you inspect these, you&#8217;ll see that iThemes Security has a &#8220;create_database_tables&#8221; function that creates the above tables. However, it also shows that WordPress has settings that are tied to the site<sup><a href=\"#footnote_1_4243\" id=\"identifier_1_4243\" class=\"footnote-link footnote-identifier-link\" title=\"https:\/\/codex.wordpress.org\/Function_Reference\/add_site_option\">1<\/a><\/sup>, rather than the plugin. <\/p>\n<p>These are stored in &#8220;wp_options&#8221;:<\/p>\n<pre lang=\"sql\">\nmysql> select * from wp_options limit 10;\n<\/pre>\n<pre>\n+-----------+--------------------+----------------------------------+----------+\n| option_id | option_name        | option_value                     | autoload |\n+-----------+--------------------+----------------------------------+----------+\n|         3 | siteurl            | https:\/\/www.garysieling.com\/blog | yes      |\n|         4 | blogname           | Gary Sieling                     | yes      |\n|         5 | blogdescription    | Philadelphia Software Developer  | yes      |\n|         6 | users_can_register | 0                                | yes      |\n|         7 | admin_email        | gary@garysieling.com             | yes      |\n|         8 | start_of_week      | 1                                | yes      |\n|         9 | use_balanceTags    | 0                                | yes      |\n|        10 | use_smilies        | 1                                | yes      |\n|        11 | require_name_email | 1                                | yes      |\n|        12 | comments_notify    | 1                                | yes      |\n+-----------+--------------------+----------------------------------+----------+\n<\/pre>\n<p>The iThemes security values are a bit long, but you can see there are 17 of them:<\/p>\n<pre lang=sql\">\n select count(*) from wp_options where option_name like 'itsec%';\n<\/pre>\n<pre>\n+----------+\n| count(*) |\n+----------+\n|       17 |\n+----------+\n<\/pre>\n<p>You can then use the mysqldump command above, but just exporting the relevant values from iThemes Security:<\/p>\n<pre lang=\"sql\">\nmysqldump -p garysielingcom wp_options --where=\"option_name like 'itsec%'\" > wp_options.sql\n<\/pre>\n<p>To re-import these settings, you just need to run statements to delete the values you&#8217;re importing, then re-run the SQL scripts you&#8217;ve created. Deleting the values that match what you export allows you to simply re-import (i.e. there would be no issues merging values the plugin install code may have created if you&#8217;re migrating to another site).<\/p>\n<ol class=\"footnotes\"><li id=\"footnote_1_4243\" class=\"footnote\">https:\/\/codex.wordpress.org\/Function_Reference\/add_site_option<span class=\"footnote-back-link-wrapper\"> [<a href=\"#identifier_1_4243\" class=\"footnote-link footnote-back-link\">&#8617;<\/a>]<\/span><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>How to approach exporting settings for a Wordpress plugin<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[12],"tags":[601],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"How to approach exporting settings for a Wordpress plugin\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gary\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gary Sieling - Software Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"WordPress: Exporting Settings for a plugin - Gary Sieling\" \/>\n\t\t<meta property=\"og:description\" content=\"How to approach exporting settings for a Wordpress plugin\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-06-01T12:59:44+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-06-01T12:59:44+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"WordPress: Exporting Settings for a plugin - Gary Sieling\" \/>\n\t\t<meta name=\"twitter:description\" content=\"How to approach exporting settings for a Wordpress plugin\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#blogposting\",\"name\":\"WordPress: Exporting Settings for a plugin - Gary Sieling\",\"headline\":\"WordPress: Exporting Settings for a plugin\",\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"},\"datePublished\":\"2016-06-01T12:59:44+00:00\",\"dateModified\":\"2016-06-01T12:59:44+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#webpage\"},\"articleSection\":\"How-To, wordpress\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/how-to\\\/#listItem\",\"name\":\"How-To\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/how-to\\\/#listItem\",\"position\":2,\"name\":\"How-To\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/how-to\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#listItem\",\"name\":\"WordPress: Exporting Settings for a plugin\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#listItem\",\"position\":3,\"name\":\"WordPress: Exporting Settings for a plugin\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/how-to\\\/#listItem\",\"name\":\"How-To\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/\",\"name\":\"gary\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"gary\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#webpage\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/\",\"name\":\"WordPress: Exporting Settings for a plugin - Gary Sieling\",\"description\":\"How to approach exporting settings for a Wordpress plugin\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/wordpress-exporting-settings-plugin\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"datePublished\":\"2016-06-01T12:59:44+00:00\",\"dateModified\":\"2016-06-01T12:59:44+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"WordPress: Exporting Settings for a plugin - Gary Sieling","description":"How to approach exporting settings for a Wordpress plugin","canonical_url":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#blogposting","name":"WordPress: Exporting Settings for a plugin - Gary Sieling","headline":"WordPress: Exporting Settings for a plugin","author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"},"datePublished":"2016-06-01T12:59:44+00:00","dateModified":"2016-06-01T12:59:44+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#webpage"},"isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#webpage"},"articleSection":"How-To, wordpress"},{"@type":"BreadcrumbList","@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.garysieling.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/how-to\/#listItem","name":"How-To"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/how-to\/#listItem","position":2,"name":"How-To","item":"https:\/\/www.garysieling.com\/blog\/category\/how-to\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#listItem","name":"WordPress: Exporting Settings for a plugin"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#listItem","position":3,"name":"WordPress: Exporting Settings for a plugin","previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/how-to\/#listItem","name":"How-To"}}]},{"@type":"Organization","@id":"https:\/\/www.garysieling.com\/blog\/#organization","name":"Gary Sieling","description":"Software Engineer","url":"https:\/\/www.garysieling.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author","url":"https:\/\/www.garysieling.com\/blog\/author\/gary\/","name":"gary","image":{"@type":"ImageObject","@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g","width":96,"height":96,"caption":"gary"}},{"@type":"WebPage","@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#webpage","url":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/","name":"WordPress: Exporting Settings for a plugin - Gary Sieling","description":"How to approach exporting settings for a Wordpress plugin","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/#breadcrumblist"},"author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"creator":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"datePublished":"2016-06-01T12:59:44+00:00","dateModified":"2016-06-01T12:59:44+00:00"},{"@type":"WebSite","@id":"https:\/\/www.garysieling.com\/blog\/#website","url":"https:\/\/www.garysieling.com\/blog\/","name":"Gary Sieling","description":"Software Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gary Sieling - Software Engineer","og:type":"article","og:title":"WordPress: Exporting Settings for a plugin - Gary Sieling","og:description":"How to approach exporting settings for a Wordpress plugin","og:url":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/","article:published_time":"2016-06-01T12:59:44+00:00","article:modified_time":"2016-06-01T12:59:44+00:00","twitter:card":"summary_large_image","twitter:title":"WordPress: Exporting Settings for a plugin - Gary Sieling","twitter:description":"How to approach exporting settings for a Wordpress plugin"},"aioseo_meta_data":{"post_id":"4243","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-02-04 16:55:39","updated":"2026-07-06 01:57:51","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\/category\/how-to\/\" title=\"How-To\">How-To<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWordPress: Exporting Settings for a plugin\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.garysieling.com\/blog"},{"label":"How-To","link":"https:\/\/www.garysieling.com\/blog\/category\/how-to\/"},{"label":"WordPress: Exporting Settings for a plugin","link":"https:\/\/www.garysieling.com\/blog\/wordpress-exporting-settings-plugin\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/4243"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=4243"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/4243\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=4243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=4243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=4243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}