$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Prevent creation of unused database tables?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Prevent creation of unused database tables?

matteradmin10PV0评论

I have a Wordpress Multisite, and when a new site is created all the Wordpress database tables are created, but most are unused by me. Is it possible to prevent creation of these tables:

_commentmeta
_comments
_links
_termmeta
_term_relationships

They are always empty on my sites, as I have disabled for example comments.

These two tables only ever includes one post:

_terms
_term_taxonomy

Which is uncategorized and category, can I disable this somehow?

I want to clean up the database creation before opening up my site for registration, to not clutter down the database with unneccessary things.

I have a Wordpress Multisite, and when a new site is created all the Wordpress database tables are created, but most are unused by me. Is it possible to prevent creation of these tables:

_commentmeta
_comments
_links
_termmeta
_term_relationships

They are always empty on my sites, as I have disabled for example comments.

These two tables only ever includes one post:

_terms
_term_taxonomy

Which is uncategorized and category, can I disable this somehow?

I want to clean up the database creation before opening up my site for registration, to not clutter down the database with unneccessary things.

Share Improve this question asked Jan 4, 2019 at 9:35 joq3joq3 3813 silver badges21 bronze badges 1
  • This is a terrible idea. You wouldn’t ask how to delete files inside WordPress for features you don’t use would you? So why delete the tables? It’s not going to help performance or anything. It’s likely just to break WordPress. Leave them alone. – Jacob Peattie Commented Jan 4, 2019 at 9:52
Add a comment  | 

1 Answer 1

Reset to default 0

I'm afraid it won't be easy to do (if possible at all).

These tables are empty and you don't use them, but... There are still many SQL queries that use them in JOINs. It means, that if you remove these tables, these JOINs queries will cause errors. There are many functionalities in backend, that use these tables - you'll break those parts too.

On the other hand - removing these tables doesn't make much sense. They're empty, so they won't cause any performance issues. And they're not clutter - they're just DB structure.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far