A standard WordPress installation creates a set of database tables that store various types of data, such as posts, users, comments, and settings. Apart from this plugins create their tables and some themes may also do that, but deactivating such plugins and themes leaves their tables on your website clattering your database.
In this lesson, you will learn about the main 12 standard WordPress database tables so that whenever you like to clean up your database you don’t disturb the core tables that are the life-line of your WordPress site.
- wp_posts – Stores all content types like posts, pages, revisions, and custom post types.
- wp_postmeta – Contains metadata (custom fields) for posts, such as additional information like SEO settings or image data.
- wp_users – Holds information about all registered users, including username, password, email, and user roles.
- wp_usermeta – Stores additional metadata about users, such as permissions, preferences, and profile information.
- wp_options – Contains various site-wide settings such as the site URL, admin email, time zone, and installed plugins.
- wp_terms – Stores the categories, tags, or any custom taxonomies used to classify content.
- wp_term_taxonomy – Describes the taxonomy (e.g., category, tag) for each term from the
wp_terms
table. - wp_term_relationships – Links posts, pages, or custom post types to their respective terms (categories, tags).
- wp_comments – Stores comments on posts and pages, including comment content, user details, and approval status.
- wp_commentmeta – Contains metadata about comments, such as IP addresses, ratings, or spam status.
- wp_links – Used to manage the blogroll feature, which is now deprecated but still exists in older versions.
- wp_actionscheduler_actions (optional in newer WordPress versions) This is used to store scheduled actions or cron jobs, commonly created by WooCommerce and other plugins.
Each table uses a default prefix of wp_
.
While installing WordPress manually on your hosting account, a step asks you to enter the database name, database username, database user password, and host and the last field asks for the table prefix which by default isĀ wp_.
This wp_ is the table prefix. this can be changed during installation to enhance security (e.g., mywebsite_
) and it also lets you host multiple websites on a single database.
To change the table prefix while installing WordPress using Installatron, in the “Advanced Settings” section, you’ll find an option for “Table Prefix.” By default, the table prefix is set to wp_
, but you can modify this to a unique prefix, such as mywebsite_
or any combination of letters and numbers for added security.
After entering your desired prefix, continue with the installation process as usual. This change helps secure your site by preventing common SQL injection attacks that target the default table prefix.