This documentation is only valid for older versions of Wordfence. If you are using Wordfence 7 or later, please visit our new documentation.

Handling script conflicts on admin pages

From Wordfence Documentation
Revision as of 18:30, 9 February 2017 by WFMattr (Talk | contribs)

Jump to: navigation, search

Some plugins or themes may cause conflicts with scripts, that can prevent some WordPress admin pages from working when both Wordfence and the other plugin (or theme) are enabled.

First, it is best to Open the JavaScript console and check for errors. This may show which plugin has caused the conflict.

If one of the errors comes from "load-scripts.php", that is because WordPress combines multiple scripts into a single request so admin pages load a little more quickly, but since multiple scripts are loaded at once, an error in one script can affect the others. You can prevent this, so that each script will load individually by adding this line of code to your wp-config.php file:

define('CONCATENATE_SCRIPTS', false);

Be sure to add it before the line that says: /* That's all, stop editing! Happy blogging. */

This will either help show which script file is causing the conflict, or it may prevent the issue from happening. If you can find the cause of the conflict and fix it, you can remove this line from wp-config.php.

If you use a plugin that "minifies" scripts or concatenates (combines) scripts, any script that is loaded can trigger a problem with other scripts. This type of feature is usually included in a caching or optimization plugin. You can temporarily disable the caching or optimization plugin and check if the problem still occurs. If it stops occurring, there are a few ways it can be fixed:

  • If your caching/optimization plugin allows you to exclude some scripts from optimization, you can add Wordfence's scripts to that list. This is the easiest solution, but may still leave conflicts between other plugins aside from Wordfence.
  • Temporarily disable other plugins, except for Wordfence and the caching/optimization plugin. Then, enable one additional plugin at a time until the problem occurs again. When you find which plugin causes the conflict, you can report the issue to the plugin author. Be sure to mention which caching/optimization plugin you are using too, since that can help them see what happened.
  • Temporarily switch themes and see if the problem still occurs. Some themes contain scripts and could cause the same problem.