Skip Navigation

[Resolved] A field that contains a script will not display unless you are logged in

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Tim Elliott 4 years, 3 months ago.

Assisted by: Nigel.


I have a custom multi-line field that contains a script for a certain post:

<script type="text/javascript" src="<em><u>hidden link</u></em>"></script>

I'm displaying it in a content template using:

[types field='casino-cta-script' output='raw'][/types]

When I'm logged in to admin and I view the post on the frontend the banner is displayed as expected.
When I'm not logged in and I view the post the banner is not displayed. There is no code being shown.

If I change the field value to some text it does display on the frontend, it's just the code that doesn't get rendered.
I've also tried it with a single line field and the same thing happens.

Link to a page where the issue can be seen: hidden link
Just below the "Ratings" section is a grey bar where the banner should appear.



Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tim

It seems to be a problem with the script you are calling rather than with the Types custom field.

I set up a local test to confirm that script tags work okay inside a multiline field whether logged in or not (with a simple text alert) and it did.

So, following your example, I added a slightly more complex case where I was src-ing an external script, but I got the same result.

I linked to some random library available on a CDN and used it and it worked whether logged-in as an admin or visiting the page as a guest.

Concretely, this is what I added to my multiline text field:

<script type="text/javascript" src="<em><u>hidden link</u></em>"></script>

<script type="text/javascript">

adblockDetect( function(adblockDetected) {

    if (adblockDetected) {
        console.log('Ad blocker is detected');
    } else {
        console.log('Ad blocker is not detected');

    }, {
    testInterval: 40,
    testRuns: 5


The first script tag pulls in an external script, the second script tag uses it, sending messages to the console.

And it worked, as I say, in either scenario.

So the problem appears to be particular to your script.

I suggest you try to reproduce my test to confirm the same. If you get different results then we'd need to try testing for conflicts with other plugins or your theme, etc.


Hi Nigel

Thanks for testing. I think it's nothing to do with Toolset now, so sorry to have taken up your time. I believe it's the caching plugin causing the problem.

Thanks for your help.



Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sure, no problem.

If that is the case then please feel free to close.


My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.