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
- Why does WordPress use outdated jQuery v1.12.4?
- Post meta vs separate database tables
- How to add a javascript snippet to the footer that requires jQuery
- Is it mandatory to use $wpdb->prefix in custom tables
- How to include jQuery and JavaScript files correctly?
- Update Option Stored in Multi-Dimensional Array
- 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?
- Remove profile picture option (and other things) from profile.php (in admin)
- Using a database view = evil incarnate?
- Test to see if jQuery or Prototype is queued by another plugin?
- Writing a plugin that notify my friends of new post that mentions(@) them
- Getting wrong relationship value in $args in wp_Query?
- WordPress and multithreading
- jQuery in header or footer
- Hook the Keydown Event in the TinyMCE Post Editor
- Not sure the best way to save custom plugin data
- The ideal place for storing persistent PHP objects
- What is the correct way for plugins to create tables with special charset/collation considerations?
- 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?
- Plugin development with unit tests
- How is the data stored in the database?
- Formatting of curly brackets array from WP database to get more readable output
- 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
- Hello dolly type plugin that allows people to add their own
- Sample — test — data for large WordPress install
- Custom Plugin Database relations
- 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
- wp_enqueue_style built in styles
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- How to store data for posts/pages built with drag-n-drop builder?
- Database for development
- Admin-ajax.php appending a status code to ajax response
- Plugin admin page meta_box toggle and order state not saving
- Is there a naming convention for database tables created by a plugin?
- WordPress plugin options and jQuery
- Activation hook not creating table
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- Ajax in WordPress – path issue
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- Saving data from block editor to the database
- What for the tables ending with the meta used in database of wordpress?
- Creating table with plugin is not working
- Mixing Regular Javascript With jQuery in a Plugin
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- Loading jQuery and jQuery plugin script files correctly [duplicate]
- Get a custom table to an array
- 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
- Add a row on clicking each post featured image
- Subscribe to author?
- 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)
- How should I store a log for my plugin
- How to create database table, add data, update and delete using wpdb via plugins?
- Create a clone from one WordPress site to another in a few minutes
- Using WPDB to output raw XML fails because of wp-blog-header.php
- Strange issue saving custom field data for a WooCommerce order
- how to search users by ajax live search
- How to perform a heavy and long process in cron jobs?
- How to add additional field in a table row after creating a table?
- WordPress plugin tables become corrupt
- Post data in wp-admin to external database
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- Page reload occurs before request finishes
- Loading jQuery library from WordPress admin
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- 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
- How to create a database table in WordPress using PHP
- How react js and other Javascript Technologies works on WordPress plugin?
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Can I log the searches that are returning 404 in the DB?
- Programmatically creating posts based on external JSON feed (asynchronously)
- Do Not Back Up? Is there any accepted way to tell backup and clone plugins to skip a certain file? [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
- Making a user platform reachable by a qr code on a pin-back-button [closed]
- multiple record insert creating many duplicate records
- Custom Plugin Breaks Other Plugin Functions
- Custom database table entry edit page
- Update Cache on Save Instead of Clearing It?
- Images stored from external API not loading
- WordPress Media Uploader not displaying image that has just been uploaded
- Is there a way to force plugins to use Flyway migrations for database changes?