How to Fix "Elementor\Core\Schemes\Typography not found" Error: A Quick Script Solution
What Causes This Error?
This error occurs when Elementor is unable to find the Typography class, which is essential for handling typography settings in Elementor widgets. There are several reasons why this might happen:
- Deprecated API: Elementor deprecated the Typography and Color scheme classes in version 3.10.0
- Plugin conflicts: Other plugins or themes that rely on these deprecated classes
- Corrupted installation: Issues with your Elementor installation
- Outdated third-party plugins: Plugins that haven't been updated to use the new Elementor API
The Domino Effect Problem
Here's where it gets tricky: often other plugins or themes rely on the Typography class, so simply disabling Elementor will cause those plugins to fail as well. This creates a cascade of errors that can be frustrating to resolve.
In an ideal world, you would update all the plugins that rely on the deprecated Typography and Color classes. However, that's not always possible when you need your site back up and running immediately.
The Quick Fix Solution
I've created a simple bash script that replaces the deprecated Typography and Color class references with hardcoded values to prevent the error from occurring. This is a temporary fix that will get your site operational while you work on a more permanent solution.
Important Note
Before running this script, you should definitely back up your site, as it will permanently modify your plugin files.
#!/bin/bash
# Define the directory to search, usually the plugins directory
# Adjust the path as necessary for your WordPress installation
# For example, if your WordPress installation is in /var/www/html, you might set
# DIRECTORY="/var/www/html/wp-content/plugins"
# For WP Engine it usually is:
DIRECTORY="/home/wpe-user/sites/SITE_NAME/wp-content/plugins"
# Define the replacements as an associative array
declare -A REPLACEMENTS=(
["Scheme_Typography::TYPOGRAPHY_1"]="1"
["Scheme_Typography::TYPOGRAPHY_2"]="2"
["Scheme_Typography::TYPOGRAPHY_3"]="3"
["Scheme_Typography::TYPOGRAPHY_4"]="4"
["Scheme_Color::get_type()"]="'color'"
["Scheme_Color::COLOR_1"]="1"
["Scheme_Color::COLOR_2"]="2"
["Scheme_Color::COLOR_3"]="3"
["Scheme_Color::COLOR_4"]="4"
)
# Find all PHP files in the directory and subdirectories
find "$DIRECTORY" -type f -name "*.php" | while read -r file; do
# Loop through the replacements and apply them
for key in "${!REPLACEMENTS[@]}"; do
sed -i "s/${key}/${REPLACEMENTS[$key]}/g" "$file"
done
echo "Processed: $file"
done
echo "All replacements completed."
How to Use This Script
- Backup your site first - This script modifies files directly, so always create a backup
- Update the directory path - Replace SITE_NAME with your actual site name
- Make the script executable: chmod +x fix-elementor-typography.sh
- Run the script: ./fix-elementor-typography.sh
What the Script Does
The script performs the following replacements across all PHP files in your plugins directory:
Scheme_Typography::TYPOGRAPHY_1 → "1" Scheme_Typography::TYPOGRAPHY_2 → "2" Scheme_Typography::TYPOGRAPHY_3 → "3" Scheme_Typography::TYPOGRAPHY_4 → "4" Scheme_Color::get_type() → "'color'" Scheme_Color::COLOR_1 → "1" Scheme_Color::COLOR_2 → "2" Scheme_Color::COLOR_3 → "3" Scheme_Color::COLOR_4 → "4"
Important Considerations
This is a Temporary Fix
While this script will get your site running again, it's important to understand that this is a quick fix, not a permanent solution. The proper approach is to:
- Update all plugins that use the deprecated Elementor API
- Contact plugin developers if updates aren't available
- Consider alternative plugins if developers aren't responsive
Potential Risks
- File modification: The script modifies your plugin files directly
- Update conflicts: Plugin updates may overwrite these changes
- Functionality limitations: Some advanced typography features may not work as expected
When to Use This Script
This script is best used when:
- Your site is down and you need it back up immediately
- You're waiting for plugin developers to release updates
- You're in the process of migrating to alternative solutions
- You need time to properly test updated plugins
Long-term Solutions
For a permanent fix, consider these approaches:
- Update plugins regularly: Keep all Elementor-dependent plugins updated
- Choose actively maintained plugins: Select plugins with regular updates
- Monitor deprecation notices: Stay informed about Elementor API changes
- Test updates in staging: Always test plugin updates before applying to production
Conclusion
The "Elementor\Core\Schemes\Typography not found" error can be frustrating, but it's manageable with the right approach. This script provides a quick way to get your site back online while you work on implementing proper, long-term solutions. Remember: while quick fixes have their place in emergency situations, investing time in proper updates and maintenance will save you headaches in the long run. Always backup your site before making changes, and consider this script as a bridge to a more permanent solution rather than a final fix.
Check out hassle-free WordPress Maintenance Plans where we can deal with such errors for you and WordPress Maintenance Plans