WordPress Login Redirect Loop: Fix Being Sent Back to wp-login
You type the right password and WordPress sends you back to the login page. The cause is usually cookies, address settings, caching…
A bloated database can slow the admin and every page load. Learn to measure autoloaded options, clear transients and revisions safely and test the result.
A WordPress database cleanup removes data your site no longer needs, such as expired temporary values, old revisions and leftovers of plugins you deleted. A very large or messy database can make the admin slow and add work to every page load, mostly through “autoloaded” options that WordPress reads on each request. This guide shows how to measure first, back up, and clean the safe areas in a careful order, without deleting things you do not understand.
Take a tested backup, then measure: Site Health reports the autoloaded options size and warns above a default threshold of 800,000 bytes, and WP-CLI can list the largest ones. Review large autoloaded options and find out which plugin owns them; delete only expired transients, limit post revisions and empty old trash; optimise tables if your host allows. Compare the result with your measurements. Do not run a cleanup plugin blindly on a live site, because it can delete data you still need.
How this guide was prepared: it is research-based. We read the WordPress source code and the WP-CLI documentation listed under Sources, checked on October 23, 2026. We did not clean your database, and the speed benefit varies a lot by site, so we promise no figures.
WordPress keeps posts, comments, users and settings in a database. Three areas often grow. Options hold settings, and options marked as autoloaded are loaded on every request. The WordPress source says autoloaded options are configuration settings for plugins and themes that are loaded with every page load, and its Site Health test (added in WordPress 6.6) turns critical when the total size passes 800,000 bytes by default. Transients are temporary cached values with an expiry time. Revisions are saved versions of posts; the constant WP_POST_REVISIONS can limit them, and trashed items are removed after the number of days set by EMPTY_TRASH_DAYS, which WordPress defaults to 30.

Deleted rows cannot be undone, so take a full database backup and make sure you can restore it, ideally on a staging copy first. See is your WordPress backup really safe, and note the time so you can compare before and after.
Open Tools → Site Health and read any message about autoloaded options. Your host’s database tool shows the size of each table. With WP-CLI, wp option list --autoload=on --fields=option_name,size_bytes lists autoloaded options with their sizes (pipe it through sort to see the biggest). Write down the numbers, because you need them to know whether the cleanup helped. If the admin feels slow, also see WordPress slow after installing a plugin.
A large autoloaded option is not always bad: it may be a plugin’s real settings. Find the owner by the option name prefix, then decide: keep it, ask the plugin whether it can store the data differently, or, if the plugin is gone, remove its leftover option after confirming it is not used. Never delete options you cannot identify. Changing an option to not autoload is also possible but is best done by someone who knows how the plugin reads it, because it can slow a page that needs it.
Transients with an expiry time are safe to remove once they have expired. WP-CLI offers wp transient delete --expired. Do not delete transients that are still valid just to reduce row counts, because the plugin will rebuild them and may slow the next request. If you use a persistent object cache, transients may live there instead of in the database.
Revisions help you roll back, but hundreds per post add weight. You can cap them by setting WP_POST_REVISIONS in wp-config.php to a number such as 10, which affects future revisions; old ones remain until deleted. Trashed posts, pages and comments are removed after the EMPTY_TRASH_DAYS period, 30 days by default. Delete old revisions only after your backup, and keep the recent ones for content you are still editing.
After deleting rows, a table can still occupy extra space. Your host’s database tool or wp db optimize can reclaim it, if your host allows that. Then repeat the measurements from Step 2, compare page and admin speed, and test your forms, search and any store flows. If anything broke, restore the backup and clean in smaller steps. See also Largest Contentful Paint in WordPress for page speed beyond the database.
It can be, but it may delete data you need. Back up first and review what it will remove.
Sometimes. The effect depends on what was bloated. Measure before and after.
Settings WordPress loads on every request. If they grow too large, every page pays the cost.
You can, after a backup, but you lose the ability to roll back older edits.
Back up, measure, and clean the safe areas first. If you would like help auditing your database, wpallsolution offers WordPress maintenance packages, including speed work in the higher tiers. We cannot promise a speed result.
You type the right password and WordPress sends you back to the login page. The cause is usually cookies, address settings, caching…
Most break-ins start at the login screen. Use this practical checklist for passwords, two-step login, admin accounts, attempt limits and HTTPS.
A staging site lets you test updates on a copy before customers see them. Learn how to create one, lock it down…
Black FridayCyber Monday sale
Before you go,
Our biggest discount of the year on the first payment of every maintenance plan.
BF2026 at checkout