The only native import/export facility is the one under Tools in the admin. And even that needs an extension (plugin) for importing from different formats.
It’s pretty straightforward to build one yourself. Something along the lines of:
$options = get_my_options();
header( 'Content-disposition: attachment; filename=my_export.txt' );
header( 'Content-Type: text/plain' );
echo json_encode( $options );
exit;
And conversely:
if ( ! empty( $_FILES['my_import']['tmp_name'] ) ) {
if ( $import = file_get_contents( $_FILES['my_import']['tmp_name'] ) ) {
if ( $options =@ json_decode( $import ) ) {
save_my_options( $options );
}
}
}
Related Posts:
- ajaxurl not defined on front end
- Is it mandatory to use $wpdb->prefix in custom tables
- How to include jQuery and JavaScript files correctly?
- Plugin API for easy admin list table generation, handling & exporting of MySQL tables?
- How Do I Use jQuery UI In My Plugin
- Default table collation on plugin activation?
- Using a database view = evil incarnate?
- Test to see if jQuery or Prototype is queued by another plugin?
- Getting wrong relationship value in $args in wp_Query?
- WordPress and multithreading
- jQuery in header or footer
- Add a jQuery function to admin pages
- How to Add a .js file Only in one specific Page Dynamically to Head
- What is the added “complexity” of custom tables?
- How is the data stored in the database?
- How to modify post content before writing to database?
- Actions or filters fired when data is saved in a custom table
- Help adding image upload functionality to widget
- How to trap “Publish” button to check for meta box validation?
- Use js script from one plugin in another plugin
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- Using Ajax call in jQuery doesn’t work in widget
- How to store data for posts/pages built with drag-n-drop builder?
- Plugin admin page meta_box toggle and order state not saving
- Ajax in WordPress – path issue
- What for the tables ending with the meta used in database of wordpress?
- Creating table with plugin is not working
- Loading jQuery and jQuery plugin script files correctly [duplicate]
- jquery document ready function not being called [closed]
- Update/insert only a column of database table
- How to Create database table when Plugin installed/activated, and delete database when Plugin deleted
- how to add Jquery script to one page?
- I’m designing a plugin to create database indexes. Suggestions?
- Is there an event or an other method that tells me the preview is loaded?
- WordPress database error for query INSERT INTO
- How to connect to AWS RDS external database (not for the core WordPress db)
- Strange issue saving custom field data for a WooCommerce order
- how to search users by ajax live search
- Form doesnt save to database
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- Display WordPress the_content() via data attributes
- javascript datatables in a plugin
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- Plugin Development for registered users
- WordPress custom taxonomy check box to dropdown
- Hide shortcodes “code” when using the “editor” the same as wordpress do with “gallery”
- Optimising a big WordPress site
- wpdb->prepare and mysql UPDATE – how is it done?
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- dbDelta SQL Query Not Working
- What is the best way to store a few fields?
- Plugin: database creation
- should i be checking for jquery before enqueing it in a plugin
- Show dynamic list of products from custom api of another database under same host
- jQuery instantly executes (a button click and css change) on load
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- Make Database query only when option is updated
- making a plugin that moves other plugins wp_head actions to wp_footer
- Can we intercept user_login and user_pass from a wp_login_form?
- WP: Search and replace in DB programmatically
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Plugin Development: Storing and Manipulating Data That Fits JSON in Database
- How do I debug an error that a plugin is causing?
- Use options to control jQuery plugin
- How to localize data array in plugin’s option page
- sanitizing/escaping plugin options
- Update plugin settings option_name for big plugin update
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Using jQuery prepend() with file include
- How to Get Last ID?
- Ajax on the Administration Side of plugin – returns 0
- Query String Filtering API
- jQueryUI draggable doesn’t work in WordPress plugin
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- setTimeout not working in jquery
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- WordPress Jquery with heade and footer sritp plugin
- Save in my custom admin page and redirect to the saved object
- Filterable posts using categories
- How to get values from Tinymce visual editor popup?
- Relational / Associate tables using native WordPress functionality
- How to store in the database directly the translation?
- How and when would I implement some code which would take data from one part of the Db and put it in another?
- Ajax call not working with
- Why Worpdress doesn’t create table in database?
- Form and database, plugin development
- Associating special meaning with user id 0
- Script work on non logged in user but not work for logged in user?
- What method should I use to store my plugin data (multi level menus with options on each item)
- How to add additional field in a table row after creating a table?
- WordPress plugin tables become corrupt
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- Page reload occurs before request finishes
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?
- How to get the value entered in the input field in wordpres
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- WordPress database error: [Table ‘bitnami_wordpress.questions’ doesn’t exist]
- How to access Elementor-navigation-elements via jQuery
- Insert meta-description into Yoast-SEO input-field via JavaScript