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?
- 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
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- 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”
- wpdb->prepare and mysql UPDATE – how is it done?
- dbDelta SQL Query Not Working
- dbDelta not installing database
- Is it necessary to do validation again when retrieving data from database?
- jquery & ajax sending data to php
- Plugin: database creation
- Adding columns to core tables
- Show dynamic list of products from custom api of another database under same host
- how to get the post id in plugin
- Can we intercept user_login and user_pass from a wp_login_form?
- How best to handle database version dependence (from $wp_db_version)
- WP: Search and replace in DB programmatically
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Using AND and bracket grouping in SQL not working
- WP ajax requests not stacking?
- Insert Into Post Not Working For Audio File Using jQuery
- jquery in wordpress plugin with depdendency
- ajax working when function is on child theme but not in plugin page
- Plugin Development: Storing and Manipulating Data That Fits JSON in Database
- Ajax +wordpress onClick link redirect to new page and create html content
- Use options to control jQuery plugin
- Save temporary registration data
- sanitizing/escaping plugin options
- Loading Images from Javascript on the Front End
- Using jQuery prepend() with file include
- How to deal with different jQuery versions?
- How to Get Last ID?
- escape html in jQuery for WordPress
- Jquery php request is returning a weird result
- Query String Filtering API
- Why User_login key doesn’t work with wp_update_user()
- jQueryUI draggable doesn’t work in WordPress plugin
- 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
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Filterable posts using categories
- Relational / Associate tables using native WordPress functionality
- WordPress doesn’t create table on plugin activation
- Insert Data into Database
- Update database record in plugin
- WordPress function is not called and ajax return 0
- How can I add the Post ID to Class Name in Jquery?
- Why Worpdress doesn’t create table in database?
- Form and database, plugin development
- Template file structure , wordpress hook for altering the template
- How do I call the dashboard’s sortable javascript in a plugin page?
- Page reload occurs before request finishes
- 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
- multiple record insert creating many duplicate records