• Hi there,

    I am using WordPress to create a website. I know how to create a template php file such as template.php for specific kinds of pages, and all these kinds of pages are going to use this template php file.

    For example, I have 10 pages to be going to use this template php file such as template.php, but to some extent, I have to create 10 pages on the WordPress admin side to fill out the content for each page. In this case, it is hard to maintain in the future because what if I have 100 pages to use this template file? If I make some changes in the future, it is impossible to open and edit each page. So how can I upload the content to phpmyadmin database by some way like JSON or XML and retrieve the data and display them to the front-end?

    I already took some time to google it but I did not find any answer for this.

    Thank you for help!

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You can directly import data using the phpMyAdmin app, usually accessed through your hosting account. Its default format is SQL, but it’ll accept properly formed XML or CSV, but not JSON. This is fine for wholesale importing of a complete WP DB exported from another server. If you wish to import by appending, it gets a lot more complicated because imported IDs can conflict with existing ones. While it’s feasible to let mySQL auto-assign IDs, any relation between tables would very likely become corrupted.

    It’s better to use an export/import plugin developed for the purpose so proper relationships can be maintained. There are many importer plugins that read foreign formats, but there are many more formats where no such plugin exists and the translation would need to be custom developed.

    Ideally, new content meant for WP should be created within WP. Export/import becomes necessary when you need to transition long existing data from another format (Blogger for example) to WP.

Viewing 1 replies (of 1 total)
  • The topic ‘upload content direct to Database and use the template file’ is closed to new replies.