WordPress 4.9.6可视化编辑器故障:切换后显示span代码无法编辑
Hey there, sorry to hear the visual editor broke after upgrading to WordPress 4.9.6. That mce_SELRES_start bookmark code you're seeing means TinyMCE (the editor under the hood) isn't initializing properly. Let's walk through some proven fixes step by step:
Clear your browser cache and cookies first
Old cached editor scripts from before the upgrade are often the culprit. HitCtrl+Shift+Delete(Chrome/Firefox) orCmd+Shift+Delete(Safari), select "Cached images and files" and "Cookies and other site data", then restart your browser. Test the editor again—this works more often than you'd think!Switch to a default WordPress theme
Custom themes sometimes have script conflicts that break TinyMCE. Temporarily activate a default theme like Twenty Seventeen (it comes pre-installed) and check if the visual editor works. If it does, your theme is the problem: look for custom code infunctions.phpthat modifies TinyMCE, or update the theme to a version compatible with WP 4.9.6.Disable all plugins
Plugins that tweak the editor (like page builders, SEO tools, or custom script add-ons) are frequent troublemakers. Go to Plugins > Installed Plugins, select all plugins, choose "Deactivate" from the bulk actions dropdown, and apply. Test the editor—if it works now, reactivate plugins one by one, testing after each, to find the conflicting one. Either update that plugin or replace it with an alternative.Reinstall WordPress core files
Sometimes upgrade files get corrupted. You can do this safely without losing your content:- Go to Dashboard > Updates in your WP admin.
- Scroll down to the "WordPress 4.9.6 is available" section (or if it says you're up to date, look for a "Reinstall Now" button).
- Click it—WordPress will replace the core
wp-adminandwp-includesfolders with fresh copies.
Alternatively, use FTP: download the WP 4.9.6 zip file, extract it, and upload thewp-adminandwp-includesfolders to your server, overwriting the existing ones (don't touchwp-contentorwp-config.php).
Reset TinyMCE's script dependencies
If none of the above works, add this code to your theme'sfunctions.phpfile (or a child theme'sfunctions.phpto avoid losing changes when updating the theme):function reset_tinymce_dependencies() { global $wp_scripts; if ( isset( $wp_scripts->registered['wp-editor'] ) ) { $wp_scripts->registered['wp-editor']->deps = array( 'wp-core-editor', 'wp-element', 'wp-i18n', 'wp-polyfill' ); } } add_action( 'admin_enqueue_scripts', 'reset_tinymce_dependencies', 100 );This forces WordPress to load the default editor scripts instead of modified versions from themes/plugins. Refresh the admin and test the editor again.
Check server configuration
Make sure your server is running PHP 5.6 or higher (WP 4.9.6 recommends PHP 7.0+ for best performance and compatibility). You can check this in Dashboard > Tools > Site Health (if available) or by creating aphpinfo.phpfile with<?php phpinfo(); ?>and uploading it to your server. Also, ask your host if mod_security or other server security rules are blocking TinyMCE's AJAX requests—sometimes these rules mistakenly flag editor traffic as malicious.
Start with the first two fixes—they're quick and often resolve the issue. If not, work your way down the list.
内容的提问来源于stack exchange,提问作者Ashique Ansari

