S
S
Sergey Krivosheev2018-06-08 08:23:52
WordPress
Sergey Krivosheev, 2018-06-08 08:23:52

Clearing all wordpress bases on import?

Good afternoon. I created my own theme and for it to work correctly, you need to import data. Unloaded in CML format by regular means (I also tried plugins).
When installing an empty WordPress distribution, it is installed with data (posts, comments, etc.). Is it possible to delete this data during import? Or when the theme is activated, can they be deleted? Or maybe it is possible to install wordpress without any data at all?
And the second question. When re-importing data, all menus, themes, etc. duplicated, which is also not correct for my situation. Ideally, when importing, clean WordPress completely. It is possible to add some hook to replace imports and force cleaning

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Krivosheev, 2018-06-08
@Nemozar

In general, I downloaded the sources https://github.com/FrankM1/radium-one-click-demo-i...
I corrected it for myself, added another "clear data" button, by clicking on which I cleared the database by hand by executing the following script:

TRUNCATE wp_commentmeta;
TRUNCATE wp_comments;
TRUNCATE wp_links;
TRUNCATE wp_postmeta;
TRUNCATE wp_posts;
TRUNCATE wp_termmeta;
TRUNCATE wp_terms;
TRUNCATE wp_term_relationships;
TRUNCATE wp_term_taxonomy;

The only other thing I saw in one of the templates was the "download demo data" button on the miniature with the template. So far I haven't been able to find a way to do this.
5b1a5e3cd9814984102118.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question