What is this syntax " {!! " I found in a PHP file?


I recently started some research into WordPress (beyond the basic stuff I’ve always done) and came across some code for a ‘navwalker’. I’m looking into it and also the concept of a mega menu. It’s early days just now but I came across the following syntax which stopped me in my tracks:

{!! $menu_navigation_left !!}

And to comment this code out

{{-- {!! $menu_navigation_left !!} --}}

I’ve not come across this before so I’m not sure if it’s PHP or WordPress specific. Or neither!?
If anyone could shed some light on this syntax and what it is used for I’d be very grateful.


This syntax is from Laravel Blade and it means display unescaped data.

By default, Blade {{ }} statements are automatically sent through PHP’s htmlspecialchars function to prevent XSS attacks. If you do not want your data to be escaped, you may use the following syntax:

Hello, {!! $name !!}.


Beware of the security issues (XSS) when using this syntax.

As for the question you made in the comments, yes, you are probably going to find a $menu_navigation_left variable somewhere in the project.

Answered By – Pedro Rocha

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published