Websites and Tech

Database

Also called MySQL, MariaDB, website database

The structured store behind a dynamic website that holds its pages, settings, users and form entries, read by the CMS each time a page is built.

Quick facts: Database

Category
Websites and Tech
Also called
MySQL, MariaDB, website database
Level
Intermediate
Affects
Site speed, backups and recovery, UK GDPR compliance, security
Where to see it
phpMyAdmin, hosting control panel, WP-CLI, Query Monitor plugin, backup plugins
In this article4
  1. How a website database works
  2. Why it matters
  3. Common mistakes
  4. How to act on it

A website database is the organised store of information that a dynamic site reads from and writes to: the text of every page, the menus and settings, user accounts, orders and the enquiries people send through forms. On most small business sites it is a MySQL or MariaDB database sitting on the hosting account next to the site’s files.

How a website database works

A content management system such as WordPress keeps its code in files and its content in the database. When someone requests a page, the server runs the CMS code, which asks the database for the right records, assembles them into HTML and sends the result to the browser. A WordPress database is split into tables: one for posts and pages, one for the extra details attached to them, one for users, one for site-wide options, and more added by plugins such as form builders, shops and SEO tools.

Because every uncached page view triggers database queries, the database’s size and tidiness affect speed. Caching helps by saving finished pages or query results so the database is asked less often. The database is also separate from the site files in another important sense: backing up the files alone does not back up the content.

Why it matters

For a UK business, the database is often where personal data quietly accumulates. A contact form plugin that saves every submission keeps names, email addresses, phone numbers and whatever people wrote in the message box, sometimes for years. Under UK GDPR that is personal data, which brings duties: keep it only as long as you need it, protect it properly, and be able to find and hand over or delete one person’s records if they ask. Someone can make a subject access request and you normally have one month to respond, which is hard if you do not know what your plugins store.

The database also matters for performance and resilience. Years of post revisions, expired temporary data, spam comments and leftovers from deleted plugins slow queries down. And a database that is not backed up, or is backed up only on the same server, can be lost along with the site in a hack or hosting failure.

Common mistakes

  • Storing every enquiry forever. If submissions are emailed to you and also saved in the database with no deletion schedule, you hold more personal data than you need. Set a data retention period and enforce it.
  • Backing up files but not the database. Restoring a site without its database gives you a theme with no content.
  • Editing the live database by hand. A search-and-replace done wrongly can break serialised data and take the site down. Test on a copy.
  • Leaving plugin tables behind. Uninstalling a plugin often leaves its tables and options, including stored personal data.
  • Weak access. Shared database passwords and phpMyAdmin left open to the internet are common weak points.

How to act on it

Start by finding out what your database holds. List the plugins that store submissions, orders or user accounts, and check how far back their records go. Decide a retention period for enquiries, write it into your privacy notice and either switch off database storage (relying on email and your CRM) or schedule deletion.

Confirm your website backup includes the database, runs daily for a site that changes often, and is stored somewhere other than the server. Then tidy up: limit stored revisions, clear expired temporary data and remove tables from plugins you no longer use, always after taking a fresh backup. Slow database queries are one of the server-side causes of poor speed I look for in a technical SEO review.

Do and do not

Do

  • Back up the database daily and off the server
  • Set a retention period for stored enquiries
  • Test any database change on a copy first

Do not

  • Keep form submissions indefinitely
  • Assume a file backup includes your content
  • Leave phpMyAdmin open to the public internet

Questions people ask about this

Where is my website database stored?

Usually on your hosting account, on the same server as your site files or on a separate database server your host manages. You can normally see it through the hosting control panel, often under a MySQL or databases section, with phpMyAdmin or a similar tool for browsing it. Your site's configuration file holds the connection details.

Do I have to delete old enquiries from my website database?

UK GDPR says you should not keep personal data for longer than you need it for the purpose you collected it. There is no single fixed period, so decide one that fits how you use enquiries, record it, and delete older records. Keeping every submission indefinitely is hard to justify.

Can a large database slow down my website?

It can, particularly on cheaper hosting. Bloated tables, especially a WordPress options table full of data loaded on every request, make each uncached page slower to build. Caching hides much of this for visitors, but admin screens, searches and checkouts often still feel the strain.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.