2

I am Created WordPress custom theme as per Html template. it was worked fine.

now I am trying to create custom export/import functionality for my custom created theme. but I don't have found a better solution for that.

so my question is how to create export/import theme options?

  • Please read carefully my question content. i am not tell about any issue. i just asking question for WordPress custom import/export theme functionality development. also, i am asked for specific one functionality not for multiple functionality. Thanks. – Rajnish Suvagiya Nov 7 '19 at 9:58
0

You don't have to export and import the tables from the database; you don't have to build an export/import function for your theme either. There is an Export tool built in WordPress under the Tools menu and in the same sub-menu you'll find the Import tool as well. The process is pretty straightforward:

  1. export the posts;
  2. make a new WP installation in the a directory;
  3. copy/install and activate the plugins if you used any on the development installation;
  4. copy your theme and activate it (this is important if you have some custom post types or custom fields associated with it or with the plugins);
  5. go to the Import screen and install the WordPress tool, it's the last in the list of tools;
  6. activate the tool and then upload the exported file.

Sidenote, exporting and importing data is not a functionality that's associated with the WordPress themes. :)

Also, the process of manual export and import of tables is tricky as there are many connections between the tables, unique ID and many more thing that can go wrong.

If you want to read more on the Export and the Import take a look in the Codex: the export screen; the import screen and some bonus read for the import.

Happy migrating!

0

Assuming that you're moving between one environment and the next (EG: dev -> Staging > Production) as a new install then you could export the database and do a find and replace on the current url with the new one.

eg: find all > https://dev.example.com replace all > https://www.example.com

Make sure you do not include the trailing slash after the TLD (.com etc) or you'll miss some urls and it won't work.

If these options are an update to an existing site you'd be better to manually transfer them over.

  • Thanks for the suggestion. but you suggest me manual process. I want to develop Wordpress theme like pro features with sample data import and export functionality. – Rajnish Suvagiya Nov 27 '18 at 12:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.