Caldera Forms 1.8 and later uses JavaScript libraries from WordPress core that will not be loaded properly if WordPress core embeds or emoji scripts are not loaded. In the JavaScript console the error “uncaught reference error, variable wp not defined.”
In Caldera Forms 1.8.5 or later, if the current logged in user can edit forms, the notice “The variable wp is not defined, your forms can not function as expected.” displayed above your Caldera Forms. If you see this notice, its likely that you have had the JavaScript error and where not aware of it. This document will help you fix this issue.
Note, the JavaScript console error may be present, without the warning above the form on Caldera Forms 1.8.0-1.8.4. This document is useful for those situations as well.
Causes Of The Caldera Forms WP Not Defined Warning
The primary causes of this notice appearing are:
- WordPress emojis are disabled.
- This can be caused by WP Rocket and should be fixed in WP Rocket 3.3.3+.
- WordPress embeds are disabled.
- This can be caused by the Disable Embeds plugin.
- This can be caused by WP Rocket and should be fixed in WP Rocket 3.3.3+.
How To Fix The Caldera Forms WP Not Defined Error
If you see the Javascript error “uncaught reference error, variable wp not defined” when submitting forms or see the notice “The variable wp is not defined, your forms can not function as expected” these are the steps you can take to resolve this issue:
- If you are using Disable Embeds plugin, please deactivate it.
- If you are using WP Rocket, make sure the disable emoji and disable embeds settings are turned off.
- Check for other ways you have disabled emojis or embeds and remove those.
If that does not work:
- For more guidance, if you are a Caldera Forms Pro customer, contact support.
- If you need a “fix it for you” solution, Contact a WordPress expert to find the cause of the issue and keep your site healthy. We recommend WP Buffs.
Other Notes
- This notice was added via this pull request. If you would like to suggest or propose improvements, please open a new issue.
- We opened an issue to investigate this issue in WordPress core.