# Fix WordPress Plugin Conflict
A plugin conflict occurs when two or more plugins fight for the same resources, hook into the same filters incorrectly, or have incompatible JavaScript dependencies. The result? White screens, fatal errors, broken admin panels, or features that mysteriously stop working.
Plugin conflicts are sneaky because they often appear after an update. Plugin A updates, now it conflicts with Plugin B that was working fine yesterday. The site was stable, then suddenly it's not.
Signs of a Plugin Conflict
Not every error is a plugin conflict, but these patterns suggest plugin issues:
- Site breaks immediately after a plugin update
- White screen of death with no error in debug log
- Certain features work in admin but not on frontend
- Shortcodes display as plain text instead of rendering
- JavaScript console errors in browser DevTools
- AJAX operations fail silently
- "Briefly unavailable for scheduled maintenance" that persists
- Error message mentioning a specific plugin file
Quick Diagnosis: The Plugin Conflict Test
The fastest way to confirm a plugin conflict:
Via WP-CLI
```bash # Deactivate all plugins at once wp plugin deactivate --all
# Test the site - does the problem go away? # If yes, reactivate plugins one by one wp plugin activate plugin-one # Test again
wp plugin activate plugin-two # Test again ```
Via FTP/File Manager
If you can't access wp-admin:
```bash # Connect via FTP or SSH cd wp-content/
# Rename plugins folder mv plugins plugins.hold
# Create empty plugins folder mkdir plugins
# Test site - should load with default theme # Now rename back rm -rf plugins mv plugins.hold plugins ```
WordPress automatically deactivates all plugins when the plugins folder disappears.
Via Database (phpMyAdmin)
```sql -- In the wp_options table, find the active_plugins option SELECT option_value FROM wp_options WHERE option_name = 'active_plugins';
-- Deactivate all plugins by setting to empty array UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins'; ```
Systematic Plugin Testing
Once you've confirmed plugins are the issue, identify the culprit systematically.
Binary Search Method
Test half the plugins at a time:
```bash # Get list of active plugins wp plugin list --status=active --field=name > active-plugins.txt
# Activate first half head -n $(($(wc -l < active-plugins.txt) / 2)) active-plugins.txt | xargs wp plugin activate
# Test site # If problem appears, culprit is in first half # If no problem, culprit is in second half
# Continue narrowing down ```
Conflict Detection Script
```bash #!/bin/bash # Save as test-plugins.sh
plugins=$(wp plugin list --status=active --field=name) arr=($plugins)
wp plugin deactivate --all echo "All plugins deactivated. Testing site..." sleep 2
for plugin in "${arr[@]}"; do wp plugin activate "$plugin" echo "Activated: $plugin" echo "Test your site now. Press Enter to continue or Ctrl+C to stop." read done ```
Check for Known Incompatibilities
Some plugins are notorious for conflicts:
```bash # Check plugin readme for known issues wp plugin get plugin-name --fields=name,title,version
# Check if plugin is tested with your WordPress version wp core version wp plugin list --fields=name,title,version,update_version ```
Common conflict pairs:
- Multiple caching plugins active simultaneously
- Multiple SEO plugins (Yoast + Rank Math + All in One SEO)
- Multiple security plugins with firewall features
- Page builders + custom post type plugins
- Minification plugins + async JavaScript loaders
Types of Plugin Conflicts
PHP Fatal Error Conflicts
One plugin declares a class or function that another already defined.
Error pattern:
Fatal error: Cannot redeclare function custom_function() (previously declared in /wp-content/plugins/plugin-one/functions.php:15)Fix:
```bash # The plugin loading later causes the error # Check which plugin loads first wp plugin list --fields=name,status,file --status=active
# Deactivate the conflicting plugin wp plugin deactivate conflicting-plugin
# Or wrap functions in if (!function_exists()) ```
JavaScript Conflicts
Plugins load different versions of the same JavaScript library.
Symptoms:
- Console errors:
$ is not a functionorjQuery is not defined - UI elements don't respond
- AJAX spinners spin forever
Diagnosis:
# Check scripts loaded
curl -s https://yourdomain.com | grep -o '<script[^>]*>' | head -20Fix:
// In theme's functions.php or custom plugin
// Force specific jQuery version
wp_deregister_script('jquery');
wp_register_script('jquery', 'https://code.jquery.com/jquery-3.6.0.min.js', array(), '3.6.0', true);
wp_enqueue_script('jquery');Hook Priority Conflicts
Two plugins hook into the same filter/action and override each other.
Example:
```php // Plugin A add_filter('the_content', 'plugin_a_modify_content', 10);
// Plugin B add_filter('the_content', 'plugin_b_modify_content', 10); ```
Fix:
// Adjust priority - higher number runs later
add_filter('the_content', 'my_modify_content', 20);Database Table Conflicts
Plugins expect different table structures for the same data.
Symptoms:
- Database errors after plugin update
- Missing data in admin panels
- SQL errors in debug.log
Diagnosis:
# Check for database errors
wp db query "SHOW TABLES LIKE '%wp_%'"
grep -i "database\|sql\|table" wp-content/debug.logFix the Conflict
Option 1: Replace One Plugin
If Plugin A conflicts with Plugin B, find an alternative:
```bash # Search for alternatives wp plugin search "seo" --fields=name,slug,rating | head -20
# Install alternative wp plugin install alternative-plugin --activate
# Remove conflicting plugin wp plugin deactivate old-plugin wp plugin delete old-plugin ```
Option 2: Load Order Manipulation
Change the order plugins load via must-use plugin:
```php // Create wp-content/mu-plugins/plugin-order.php <?php // Force specific plugins to load first add_filter('option_active_plugins', function($plugins) { $priority_plugins = [ 'essential-plugin/plugin.php', 'another-essential/plugin.php' ];
foreach (array_reverse($priority_plugins) as $plugin) { if (($key = array_search($plugin, $plugins)) !== false) { unset($plugins[$key]); array_unshift($plugins, $plugin); } }
return $plugins; }); ```
Option 3: Conditional Plugin Loading
Load plugins only where needed:
// In mu-plugins/conditional-loading.php
<?php
add_filter('option_active_plugins', function($plugins) {
// Disable heavy plugin on frontend
if (!is_admin()) {
$heavy_plugin = 'heavy-page-builder/builder.php';
if (($key = array_search($heavy_plugin, $plugins)) !== false) {
unset($plugins[$key]);
}
}
return $plugins;
});Option 4: Contact Plugin Developers
Many plugin conflicts are bugs that should be fixed:
- 1.Document the exact error
- 2.Note both plugin versions
- 3.Create a support ticket with both plugin authors
- 4.Provide error logs and reproduction steps
Prevent Plugin Conflicts
Use a Staging Environment
```bash # Create staging site wp db export live-db.sql wp db create staging_db # Configure staging wp-config.php
# Test plugin updates on staging first wp plugin update plugin-name --dry-run ```
Limit Active Plugins
```bash # Check plugin count wp plugin list --status=active --format=count
# Rule of thumb: keep under 30 active plugins # Deactivate unused plugins wp plugin list --status=active --field=name | while read plugin; do echo "Do you need $plugin? (y/n)" # Manual review recommended done ```
Regular Audits
```bash # List plugins with last update date wp plugin list --fields=name,title,version,last_updated
# Remove abandoned plugins (no updates in 2+ years) wp plugin delete old-unsupported-plugin ```
Use Quality Plugins
Before installing, check:
```bash # Check plugin rating and active installs wp plugin info plugin-slug --fields=rating,active_installs,last_updated
# Avoid plugins with: # - Rating below 4 stars # - Not updated in 12+ months # - Known compatibility issues ```
Verification
After resolving the conflict:
```bash # Check for PHP errors wp eval 'echo "No PHP errors detected\n";'
# Test frontend curl -I https://yourdomain.com
# Test admin curl -I https://yourdomain.com/wp-admin/
# Check debug log is clean tail -20 wp-content/debug.log ```
Plugin conflicts are inevitable with WordPress's plugin architecture. The key is systematic testing: isolate, identify, and resolve without guessing.