View Categories

Glossary: The WordPress Database

2 min read

What the database does #

Every piece of content on your WordPress site lives in a MySQL database. Posts, pages, comments, settings, user accounts, WooCommerce orders, plugin configuration: all of it is stored there. The WordPress files (PHP, JavaScript, CSS) are the engine. The database is the fuel. When someone visits your site, WordPress retrieves content from the database, assembles a page, and sends it to the browser.

This is why the “Error establishing a Database Connection” message takes the entire site down. It doesn’t mean your content is gone. It means WordPress can’t reach the database to retrieve it. Once the connection is restored, everything comes back exactly as it was.

The wp-config.php connection #

WordPress connects to the database using credentials stored in the wp-config.php file in your site’s root directory. These credentials are: the database name, the database username, the database password, and the database host (usually localhost). If any of these are wrong, WordPress can’t connect. This is the first thing to check when the Database Connection error appears, especially after a site migration or a hosting change where the credentials changed.

What gets stored in the database versus the file system #

The database stores content, settings, and data: posts, pages, plugin settings, options, WooCommerce orders, user accounts. The file system stores code: WordPress Core files, plugin files, theme files, and uploaded media (images, documents). When you delete a plugin through the WordPress Dashboard, it deletes the files from the file system and removes the plugin’s data from the database. When you delete it by deleting the folder via FTP, only the files are removed. The database tables and settings remain until the plugin’s uninstall routine runs.

Database tables and Loupely #

The Loupely WordPress Plugin creates one database table, wp_loupely_events (using your site’s table prefix). It stores the rolling diagnostic log. When you uninstall Loupely through the WordPress Dashboard’s standard plugin deletion process, this table is removed. When you delete the plugin folder via FTP, the table remains in your database until you manually remove it or run a database cleanup. See Uninstalling the Plugin for how to remove Loupely completely.