Issue Description
WordPress sites may occasionally display a fatal error message similar to:
Fatal error: Cannot declare class [ClassName], because the name is already in use in /home/[username]/wp-content/plugins/[plugin-name]/[file-path] on line [number]
This error occurs when two or more plugins attempt to declare the same PHP class name, creating a conflict that prevents your website from loading properly.
Common Causes
- Plugin Updates: During plugin updates, temporary conflicts may arise between old and new versions
- Duplicate Plugin Installations: Having multiple versions of the same plugin installed
- Plugin Conflicts: Two different plugins using identical class names
- Incomplete Plugin Deactivation: Residual files from previously removed plugins
Resolution Steps
Method 1: Ecenica cPanel File Manager Access (Recommended)
- Access File Manager
- Log into your Ecenica cPanel (for help see: Where do I log in to my hosting control panel)
- Click on the File Manager tool
- Locate Plugin Directory
- Navigate to:
/wp-content/plugins/ - Find the plugin folder mentioned in the error message
- Navigate to:
- Temporarily Disable the Plugin
- Rename the problematic plugin folder by adding
-disabledto the end - Example: Change
problem-plugintoproblem-plugin-disabled - This immediately deactivates the plugin and restores site access
- Rename the problematic plugin folder by adding
- Verify Site Recovery
- Check that your website loads normally
- The plugin will now appear as deactivated in your WordPress dashboard
Method 2: FTP Access
If you prefer using FTP:
- Connect to your hosting account via FTP client
- Navigate to
/wp-content/plugins/ - Download the problematic plugin folder as backup
- Rename or delete the plugin folder
- Verify site functionality
Method 3: WordPress Dashboard (If Accessible)
If you can still access your WordPress admin area:
- Go to Plugins → Installed Plugins
- Deactivate the conflicting plugin
- Delete and reinstall if necessary
Post-Resolution Actions
Reinstalling the Plugin
- From WordPress Dashboard:
- Go to Plugins → Add New
- Search for the plugin name
- Install and activate the latest version
- Manual Upload:
- Download the latest version from the plugin repository
- Upload via Plugins → Add New → Upload Plugin
Prevention Tips
- Update Plugins Individually: Update one plugin at a time to identify conflicts quickly
- Test on Staging: Use a staging environment for plugin updates before applying to live sites
- Regular Backups: Maintain current backups before making changes
- Plugin Compatibility: Check plugin compatibility with your WordPress version
Backup and Recovery Options
Using Ecenica JetBackup Service
Ecenica provides automated backup services with JetBackup on select hosting plans. This service allows you to restore to any backup from the last 30 days.
Note: JetBackup is available on select Ecenica hosting plans. If you don’t see “JetBackups” in your cPanel, you may need to upgrade your hosting plan to access this feature.
To restore your entire website:
- Access JetBackup
- Log into your Ecenica cPanel
- Click File Backups
- Select Restore Point
- Click Creation Date to sort backups by date
- Choose a backup from before the plugin conflict occurred
- Click File Manager
- Restore Files
- Select the directory or files to restore
- Click Restore Selected
- Warning: The restore will overwrite current data in your directory
- Confirm the restoration to proceed
- Monitor Progress
- Check the queue to view restore progress
- Restoration time depends on file count and data size
- You’ll receive an email notification when complete
To restore database only:
- Access Database Backups
- In cPanel, click Database Backups
- Select Database Restore Point
- Database backups are listed by database name
- Click Creation Date to sort by date
- Choose appropriate restore point and click Restore
- Confirm Database Restoration
- Warning: This will overwrite current database data
- Confirm to proceed
- You’ll receive email notification when complete
Alternative: Targeted Plugin Restoration
If you prefer to restore only the problematic plugin rather than the entire site:
- Access File Backups in cPanel
- Navigate to the backup’s file manager
- Go to
wp-content/plugins/[plugin-name]/ - Select the plugin folder and restore only that directory
Manual Backup Restoration
If you have personal backups stored outside of Ecenica:
- Replace the
/wp-content/plugins/directory with your backup version - Restore the WordPress database if needed
- Update plugins individually after restoration
Upgrading for JetBackup Access
If you don’t see backup options in your cPanel, consider upgrading your Ecenica hosting plan to access:
– Automated daily backups
– 30-day backup retention
– Easy one-click restoration
– Database backup capabilities
Contact Ecenica support for plan upgrade options.
Additional Troubleshooting
If the Error Persists
- Check Error Logs:
- Review hosting error logs for additional details
- Look for patterns in error timestamps
- Theme Conflicts:
- Temporarily switch to a default WordPress theme
- Check if the issue relates to theme-plugin conflicts
- Memory Issues:
- Increase PHP memory limit in wp-config.php:
php
ini_set('memory_limit', '256M');
- Increase PHP memory limit in wp-config.php:
When to Contact Ecenica Support
Contact Ecenica support if:
- Multiple plugins show similar conflicts.
- The error persists after plugin removal.
- You need help with JetBackup restoration.
- You need to upgrade your plan for backup access.
Data Safety
Important: Plugin conflicts typically do not cause data loss. Your posts, pages, media, and database remain intact. The error prevents the website from displaying but doesn’t delete content.