I installed the Polylang translation plugin to create a multinational site because it’s free, but when I click the translate button, I get a fatal error that prevents me from translating.
To summarize the symptom, the translation works fine for recent posts, while older posts receive a fatal error when clicking the Translate button. My guess is that I’ve translated about 100 posts since I installed it, and only those posts seem to be getting the translation error.
After checking the error logs in CyberPanel, I realized that the conflict was being caused by a piece of data called Wpil_Model_Link. I realized that the Internal Links Manager plugin I had previously installed was conflicting with the data I had translated in the past and causing the error.
The Internal Links Manager plugin was uninstalled, but the conflict was caused by data that was left in the database. To resolve this, you accessed PhpMyAdmin and deleted all of that data, and the issue was resolved.
If you have installed and uninstalled a specific plugin, but the data remains and is causing a conflict with the Polylang plugin, you may want to follow the steps below to resolve the issue. – Solution found in the question post
Table of Contents
Check the fatal error log
When you encounter a fatal error in WordPress, the first thing you should do is check the error logs. It’s a good idea to check the logs first, as this will give you an idea of what caused the error to occur, and then you can react accordingly.
If you have the panel installed and are using it, you can check the Error Logs in the Logs menu to see the error that occurred, as shown in the image above. If you don’t have the panel installed, you can follow the steps below.
// Enable debug mode
define( 'WP_DEBUG', true );
// Enable debug logs (stored in the wp-content/debug.log file)
define( 'WP_DEBUG_LOG', true );
// print errors to the screen (recommended for development environments only)
define( 'WP_DEBUG_DISPLAY', false ); // print errors to the screen if set to true
@ini_set( 'display_errors', 0 );
// enable script debugging (trace CSS/JS errors)
define( 'SCRIPT_DEBUG', true );
// Bypass repository cache (useful for troubleshooting cache issues related to certain plugins/theme)
define( 'SAVEQUERIES', true );
If you don’t have the panel installed, adding the code above to your wp-config.php file will enable debug mode so you can check for errors.
Delete data related to Wpil_Model_Link
In the Error Logs, we’ve seen that a fatal error occurred in the data associated with Wpil_Model_Link, so we need to delete that data. When deleting data, it’s important to make sure you have a backup because things can go wrong.
To delete the database, you need to access PhpMyAdmin. If you have the panel installed, navigating to the DataBases menu will give you access to the service. If you don’t have the panel installed, you can either install PhpMyAdmin to access it or use a plugin to access it temporarily.
Check the database for relevant data
Once you’re in PhpMyAdmin, you’ll see a list of databases on the left. From there, you can select your WordPress-related database and click “SQL” in the top menu.
Once you click SQL, an empty space will appear. Enter the command below to retrieve the Wpil_Model_Link data, then click the Run button in the bottom right corner.
SELECT * FROM wp_postmeta WHERE meta_value LIKE '%Wpil_Model_Link%';
After entering the above command, you can check if the Wpil_Model_Link data exists. If it does exist, you can delete it by following the steps below.
Deleting related data
If the data remains, you can delete it by entering the command below and pressing the Run button.
DELETE FROM wp_postmeta WHERE meta_value LIKE '%Wpil_Model_Link%';
After deleting the Wpil_Model_Link data, go back to WordPress and check if the translation feature is working again. If it still doesn’t work, there may be an issue with the remaining Polylang data, and you’ll want to clean that up as well.
Deleting Polylang data
If deleting the Wpil_Model_Link data still results in a fatal error, you can also try deleting the Polylang plugin data. It’s important to note that deleting Polylang data will reset everything, including translated posts and settings, so backups are a must.
DELETE FROM wp_options WHERE option_name LIKE 'pll_%';
DELETE FROM wp_postmeta WHERE meta_key LIKE '_pll_%';
DELETE FROM wp_termmeta WHERE meta_key LIKE '_pll_%';
DELETE FROM wp_terms WHERE slug LIKE 'pll_%';
DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'language';
Entering the above command in PhpMyAdmin SQL using the method described above will delete all Polylang data.
Conclusion
When using the Polylang plugin to create a translation site, data conflicts with other plugins can cause critical errors. If this happens, you can resolve the issue by uninstalling the conflicting plugin and deleting the associated data.
Once again, it’s important to note that when deleting your database, it’s important to make sure you have a backup, as this can cause problems.
▶ AMP for WP Plugin: How to Apply Automated Ads
▶ How to remove unnecessary text in WordPress all at once
▶ How to apply the HTTP/3 protocol to the OpenLiteSpeed web server