Low traffic, fast server… yet wp-admin crawls. Actual culprit Autoloaded options table Plugins storing large serialized blobs in wp_options Diagnosis SELECT option_name, LENGTH(option_value) FROM wp_options WHERE autoload=’yes’ ORDER BY LENGTH(option_value) DESC; Why it matters Autoloaded options load on every request.
Category: Wordpress
Why wp-cron Breaks Under Traffic (And How to Fix It)
wp-cron.php is not real cron. Problem High traffic = cron spamLow traffic = cron never runs Correct setup Disable wp-cron Use real server cron define(‘DISABLE_WP_CRON’, true); Then schedule: */5 * * * * curl https://example.com/wp-cron.php
Fix Random Logouts Caused by Cookie Domain Mismatch
Users get logged out randomly. No errors. Nightmare. Root cause WP_HOME, WP_SITEURL, and cookie domain mismatch (especially behind proxies or Cloudflare). Permanent fix define(‘WP_HOME’, ‘https://example.com’); define(‘WP_SITEURL’, ‘https://example.com’); define(‘COOKIE_DOMAIN’, $_SERVER[‘HTTP_HOST’]); This stabilizes sessions instantly.
Custom Login Error Message (Security Trick)
add_filter(‘login_errors’, fn() => ‘Invalid credentials.’); Why it mattersPrevents username enumeration attacks.
Disable Emojis Without Plugins
remove_action(‘wp_head’, ‘print_emoji_detection_script’, 7); remove_action(‘wp_print_styles’, ‘print_emoji_styles’); Why it mattersRemoves extra JS/CSS → faster first paint.
Custom REST Endpoint Without a Plugin
add_action(‘rest_api_init’, function () { register_rest_route(‘custom/v1’, ‘/ping’, [ ‘methods’ => ‘GET’, ‘callback’ => fn() => ‘pong’ ]); }); Why it mattersLightweight APIs for headless or automation use.
Load Plugins Only on Needed Pages
add_filter(‘option_active_plugins’, function ($plugins) { if (!is_page(‘contact’)) { $plugins = array_diff($plugins, [‘contact-form/plugin.php’]); } return $plugins; }); Why it mattersMassive performance gain without deleting plugins.
Custom Post Status for Internal Workflows
Editorial chaos? Add your own status. register_post_status(‘internal-review’, [ ‘label’ => ‘Internal Review’, ‘public’ => false ]); Why it mattersCleaner workflows without extra plugins.
Disable Heartbeat API Selectively (Not Globally)
Heartbeat eats CPU on admin screens. add_action(‘init’, function () { wp_deregister_script(‘heartbeat’); }); Why it mattersAdmin stays responsive without breaking autosave where needed.
Why Your Site Is Slow Even With Caching Enabled
Autoloaded options are silently killing performance. SELECT option_name FROM wp_options WHERE autoload = ‘yes’; Why this mattersToo many autoloaded rows = memory bloat on every request.
Stop Installing Plugins for Simple Redirects
You don’t need a plugin for redirects. # .htaccess Redirect 301 /old-page /new-page Why this mattersFewer plugins = less attack surface + faster TTFB.
Disable WordPress Cron to Fix Random CPU Spikes
WordPress pseudo-cron (wp-cron.php) runs on page load — not time-based. Why this is bad:High traffic = cron storm = CPU spikes. Proper fix: define(‘DISABLE_WP_CRON’, true); Then add a real cron job: */5 * * * * wget -q -O – https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1 Result:Predictable performance, lower server load, faster page responses.
Stop WordPress from Killing Your Site During Plugin Updates
A failed plugin update can lock WordPress into maintenance mode forever. Why it happens:WordPress creates a .maintenance file and never deletes it if PHP times out. Instant fix (no admin panel needed): /public_html/.maintenance Delete that file. Prevention (best practice): Add to wp-config.php: define(‘WP_MEMORY_LIMIT’, ‘256M’); define(‘WP_MAX_MEMORY_LIMIT’, ‘256M’); This prevents update-time PHP crashes.
WordPress Theme Updates Break Custom Fixes
Everything works… until update day. Why it happensEdits made directly to theme files. Why it mattersCustomizations get wiped. Vital fix Always use a child theme.
WordPress Pages Load Slowly Only for Logged-In Users
Guests are fast, admins suffer. Why it happensAdmin bar + disabled cache for logged-in users. Why it mattersYou think the site is slow — users don’t. Vital fix Test performance in incognito + cache enabled.
WordPress Database Grows Without Content Growth
Same content, bigger DB. Why it happensPost revisions accumulate silently. Why it mattersBackups slow down, queries degrade. Smart fixLimit revisions. define(‘WP_POST_REVISIONS’, 5);
WordPress Cron Jobs Run at the Worst Time
Scheduled tasks slow down visitors. Why it happensWP-Cron runs on page load. Why it mattersTraffic spikes = slow site. Smart fixDisable WP-Cron and use real server cron.
WordPress Media Library Becomes Unusable Over Time
Thousands of images, zero control. Why it happensNo folder or taxonomy structure. Why it mattersContent reuse and SEO suffer. Smart fixUse media taxonomy plugins early.
WordPress Search Feels Slow on Small Sites
Even with few posts, search lags. Why it happensDefault search performs full table scans. Why it mattersPoor UX even on low traffic sites. Smart fixReplace default search with indexed search plugins or custom queries.
WordPress REST API Feels Slow
API works but response time hurts. WhyUncached database queries per request. TipCache REST responses using transients.
WordPress Pages Break After Theme Update
No plugin change, layout ruined. WhyTheme update overwrote custom CSS. TipAlways place custom CSS in child theme or Customizer.
WordPress Pages Randomly Lose Formatting
Refresh fixes it sometimes. WhyConflicting cache layers (plugin + server). TipUse a single authoritative caching layer.
WordPress Admin Feels Slow but Frontend Is Fast
Visitors fine, editor painful. WhyToo many admin-side hooks and plugins. TipAudit plugins that affect admin only.
WordPress Backup Files Quietly Consume Disk
Backups exist… everywhere. WhyMultiple plugins store backups independently. TipCentralize backups and delete plugin-level archives.
WordPress Pages Look Different After Theme Updates
Content unchanged, layout broken. WhyTheme updates modify default CSS assumptions. TipAvoid relying on theme default styles for critical layout.
WordPress Media URLs Break After Migration
Images disappear after moving sites. WhyHardcoded URLs inside post content. TipAlways run a search-replace after migrations.
WordPress Sites Age Poorly Without Breaking
No errors — just slower every month. WhyOptions table grows endlessly. TipAudit autoloaded options regularly.
WordPress Databases Age Faster Than Expected
Site works… until backups get huge. WhyPost revisions and transients accumulate silently. Maintenance Tip Limit revisions and clean expired transients regularly.
WordPress Admin Loads Plugins You Don’t Use
Even inactive features affect performance. WhySome plugins hook into admin globally. Tip Remove plugins entirely instead of just disabling.
WordPress Media Library Becomes Unusable
Thousands of images, endless scrolling. WhyNo pagination optimization in default media queries. Tip Limit attachments loaded per request.
