最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - Add table to WordPress database

programmeradmin4浏览0评论

I want to add an extra table on my WordPress database and I intend to query it with a custom script that will be embedded to WordPress.

I'm worrying if this is a safe way to do it, or I should go with the option of adding an entirely new database, not a table on WordPress, as future updates of WordPress system might wipe my custom table? Any experience with such a scenario. Is this a valid risk/worry, or I should just create the table on the WordPress database, instead of creating another db, and connect to that new db in my custom script.

Thank you.

I want to add an extra table on my WordPress database and I intend to query it with a custom script that will be embedded to WordPress.

I'm worrying if this is a safe way to do it, or I should go with the option of adding an entirely new database, not a table on WordPress, as future updates of WordPress system might wipe my custom table? Any experience with such a scenario. Is this a valid risk/worry, or I should just create the table on the WordPress database, instead of creating another db, and connect to that new db in my custom script.

Thank you.

Share Improve this question edited Apr 18, 2017 at 17:29 Nathan Johnson 6,5286 gold badges30 silver badges49 bronze badges asked Apr 18, 2017 at 14:43 RyanRyan 155 bronze badges 2
  • 1 To answer your question, yes you can add a table without worry. To me the basic question is: Do I really need the extra table? Can I do it (what I am trying to do) using only WordPress API? – Laxmana Commented Apr 18, 2017 at 15:09
  • Since this has been viewed 2K times I thought this answer might help some other people. Yes, it is safe and people do it all the time. Here is a good resource for how: codex.wordpress.org/Creating_Tables_with_Plugins – codeasaurus Commented Feb 23, 2022 at 19:17
Add a comment  | 

1 Answer 1

Reset to default 2

There is no risk in creating new table in WP Database. Infact many well known and giant plugins, like Woocomerce do this.

You can also opt for creating new database but creating new table is not at all risky...

Hope I am clear enough...

发布评论

评论列表(0)

  1. 暂无评论