How exactly did you insert this code?
We added the code three different ways. and all of them resulted in the same situation.
- we used the WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager plugin
- We went straight to the files and added it
- We created a custom plugin
For all three, the code is invisible when deployed – except for the beginning and ending comments.
We see the code and it works properly when logged in.
@whyviru , there is no mention of a “user” restriction condition in the head. The code we’ve inserted is:
<!-- Begin Mainn script -->
<script
async
data-mainn-id="123"
data-environment="production"
id="mainn-widget-script"
src="https://widget.mainn.io/scripts/mainn-widget.js"
></script>
<!-- End Mainn script -->
the “123” is just an example. this code won’t work without a registered mainnID
-
This reply was modified 1 year, 4 months ago by
petermainnwp.
WordPress removes JavaScripts inserted “just like that” for security reasons. It is therefore not possible to insert this code just like that.
This article describes the options in more detail: https://www.wpbeginner.com/wp-tutorials/how-to-easily-add-javascript-in-wordpress-pages-or-posts/ – be sure to use the options described here. With WPCode, for example, you must insert it as a JavaScript snippet.
Thank you, @threadi ,
We are using the WPCode – Insert Headers and Footers plugin as suggested in the article. I’m also using this code on other sites with no errors. I’m wondering if the issue is a conflict with other plugins.