WordPress Troubleshooting Overview
WordPress-specific troubleshooting for performance issues, tracking problems, and integration conflicts. This guide addresses issues unique to the WordPress ecosystem.
Common WordPress Issues
Performance Problems
WordPress performance can be impacted by themes, plugins, hosting, and content:
- Largest Contentful Paint (LCP) - Slow theme loading, large images, server response time
- Cumulative Layout Shift (CLS) - Dynamic ad injection, web fonts, theme layout changes
- First Input Delay (FID) - Heavy JavaScript from plugins, third-party scripts
- Total Blocking Time (TBT) - Unoptimized theme code, excessive DOM manipulation
See:
- LCP Troubleshooting - WordPress-specific LCP fixes
- CLS Troubleshooting - Layout shift solutions
Tracking and Analytics Issues
WordPress's plugin ecosystem can create tracking conflicts:
- Events not firing - Plugin conflicts, caching interference, JavaScript errors
- Duplicate tracking - Multiple analytics plugins installed
- Missing data - Caching plugins serving stale content
- Server-side tracking failures - Blocked API calls, incorrect credentials
See:
- Events Not Firing - Debug tracking issues
WordPress-Specific Debugging Tools
Browser Developer Tools
Essential for diagnosing WordPress issues:
Console (JavaScript Errors):
// Check for common WordPress conflicts
console.log(window.jQuery); // jQuery version
console.log(window.wp); // WordPress API
console.log(window.dataLayer); // GTM data layer
console.log(window.gtag); // GA4
console.log(window.fbq); // Meta Pixel
Network Tab:
- Filter by
analytics.js,gtag/js,fbevents.jsto verify tracking scripts load - Check for 404 errors on plugin/theme assets
- Monitor AJAX requests from WooCommerce
Performance Tab:
- Record page load
- Identify slow WordPress plugins
- Check for render-blocking resources
WordPress Debug Mode
Enable debug mode to identify plugin/theme errors:
// Add to wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false); // Don't show errors to visitors
@ini_set('display_errors', 0);
Check debug log:
# View debug log
tail -f /path/to/wordpress/wp-content/debug.log
Query Monitor Plugin
Install Query Monitor to debug:
- Database queries (slow queries, duplicate queries)
- PHP errors and notices
- HTTP API calls (for server-side tracking)
- Enqueued scripts and styles
- Hooks and actions fired
- Environment information
Health Check Plugin
Use Health Check & Troubleshooting to:
- Test for plugin conflicts (Troubleshooting Mode)
- Check server requirements
- Verify file permissions
- Test email delivery
- Review PHP info
Common WordPress Conflicts
Plugin Conflicts
Symptoms:
- Tracking stops working after plugin update
- JavaScript errors in console
- Events fire multiple times
- Admin dashboard errors
Diagnosis:
- Enable WordPress Troubleshooting Mode (Health Check plugin)
- Disable all plugins except WordPress and tracking plugins
- Re-enable plugins one by one
- Identify conflicting plugin
Common Culprits:
- Multiple analytics plugins (MonsterInsights + GA Google Analytics)
- Aggressive caching plugins (W3 Total Cache, WP Super Cache)
- JavaScript optimization plugins (Autoptimize, WP Rocket)
- Security plugins blocking external scripts
Caching Plugin Issues
Symptoms:
- Data layer doesn't update with new data
- Tracking shows old product prices
- Events don't fire on first page load
- Different behavior logged in vs. logged out
Solutions:
WP Rocket:
// Exclude tracking scripts from optimization
add_filter('rocket_exclude_js', 'exclude_tracking_scripts');
function exclude_tracking_scripts($excluded) {
$excluded[] = 'googletagmanager.com/gtag/js';
$excluded[] = 'google-analytics.com/analytics.js';
$excluded[] = 'connect.facebook.net/en_US/fbevents.js';
return $excluded;
}
// Exclude dynamic pages from caching
add_filter('rocket_cache_reject_uri', 'exclude_dynamic_pages');
function exclude_dynamic_pages($uri) {
$uri[] = '/checkout/';
$uri[] = '/cart/';
$uri[] = '/my-account/';
return $uri;
}
W3 Total Cache:
Performance → Minify → Never minify the following JS files:
googletagmanager.com/gtag/js
google-analytics.com/analytics.js
connect.facebook.net/en_US/fbevents.js
Performance → Page Cache → Never cache the following pages:
/checkout/
/cart/
/my-account/
LiteSpeed Cache:
LiteSpeed Cache → Page Optimization → JS Excludes:
googletagmanager.com
google-analytics.com
connect.facebook.net
LiteSpeed Cache → Cache → Exclude → Do Not Cache URIs:
checkout
cart
my-account
Theme Conflicts
Symptoms:
- Tracking code doesn't appear in source
wp_headorwp_footerhooks not firing- Custom theme removes tracking on certain pages
Diagnosis: Check if theme properly implements WordPress hooks:
// In your theme's header.php, before </head>
<?php wp_head(); ?>
// In your theme's footer.php, before </body>
<?php wp_footer(); ?>
If missing, tracking code added via hooks won't load.
Solution:
- Update theme to include proper hooks
- Use child theme to add hooks
- Switch to a well-coded theme
WooCommerce Conflicts
Symptoms:
- E-commerce events don't fire
- Purchase event fires on every thank-you page visit
- Product data incorrect in tracking
Common Issues:
- AJAX Cart Updates:
// Ensure events fire on AJAX add-to-cart
add_action('wp_footer', 'track_ajax_cart_events');
function track_ajax_cart_events() {
?>
<script>
jQuery(document.body).on('added_to_cart', function(event, fragments, cart_hash, $button) {
// Fire tracking event here
gtag('event', 'add_to_cart', {...});
});
</script>
<?php
}
- Variable Products:
// Get selected variation data
jQuery('.variations_form').on('found_variation', function(event, variation) {
console.log(variation); // Check variation data available
});
Testing WordPress Sites
Local Testing Environment
Test changes before deploying to production:
Local WordPress Setup:
- Local by Flywheel - Free local WordPress environment
- XAMPP - Apache, MySQL, PHP stack
- Docker - Containerized WordPress
Staging Environment: Most WordPress hosts provide staging:
- WP Engine: Automatic staging
- Kinsta: One-click staging
- SiteGround: Staging tool
- Cloudways: Staging environment
Testing Checklist
Before deploying tracking changes:
Test with Caching Disabled
- Disable all caching plugins
- Test tracking implementation
- Re-enable caching one by one
Test Logged Out vs. Logged In
- Use incognito/private browsing for logged-out testing
- Verify admin tracking exclusion works
Test on Different Devices
- Desktop browsers (Chrome, Firefox, Safari, Edge)
- Mobile devices (iOS Safari, Chrome Mobile)
- Tablet devices
Test WooCommerce Flows (if applicable)
- Browse products → View product → Add to cart → Checkout → Purchase
- Verify each event fires correctly
- Check data accuracy (price, product ID, quantity)
Test Forms
Validation Tools
Google Analytics:
- Real-Time Reports - Immediate feedback
- DebugView - Event-level debugging
- Google Analytics Debugger Chrome extension
- Meta Pixel Helper Chrome extension
- Events Manager → Test Events
- Preview Mode - Step-through debugging
- Tag Assistant - Visual debugging
General:
- ObservePoint - Automated tag auditing
- Tag Inspector - Comprehensive tag analysis
Performance Debugging
WordPress Performance Profilers
Query Monitor: Shows database queries, PHP errors, HTTP requests:
Install Query Monitor plugin
Enable profiling
View slow queries in admin bar
New Relic: APM for WordPress:
- Server response time
- Database query performance
- External API calls
- PHP function profiling
GTmetrix / PageSpeed Insights:
- Overall page performance
- Core Web Vitals
- Resource optimization recommendations
WordPress-Specific Performance Issues
Too Many Plugins:
- Deactivate unused plugins
- Replace multiple single-purpose plugins with one comprehensive plugin
- Use lightweight alternatives (Query Monitor vs. full APM)
Unoptimized Images:
- Install image optimization plugin (ShortPixel, Imagify, EWWW)
- Use WebP format
- Implement lazy loading (native browser or plugin)
Slow Theme:
- Switch to lightweight theme (GeneratePress, Astra, Kadence)
- Remove unused theme features
- Use child theme to remove bloat
Hosting Issues:
- Upgrade to better hosting (shared → VPS → managed WordPress)
- Use WordPress-optimized hosts (WP Engine, Kinsta, Flywheel)
- Enable server-side caching (Redis, Memcached)
Getting Help
WordPress Community Resources
Plugin-Specific Support
- MonsterInsights: Support Portal
- PixelYourSite: Documentation
- GTM4WP: GitHub Issues
Performance Help
Next Steps
Dive into specific troubleshooting areas:
- LCP Issues - WordPress LCP optimization
- CLS Issues - Layout shift fixes
- Tracking Issues - Debug events not firing
Related Resources
- Global Issues Hub - Universal troubleshooting concepts
- WordPress Integrations - Set up tracking correctly from the start
- WordPress Performance Best Practices