Solution - Php Filter Module Not Exist in Drupal 8 ?

Due to security reasons, php filter module has been removed from Drupal 8. It caused adding php scripts in blocks and nodes very difficult. To overcome this problem we have created our own module and pushed it as sandbox project in

Php Shortcode - This modules provides shortcode option to execute php scripts inside blocks and nodes.

Dependencies:- Shortcode module

Project URL:-

Steps to use this module:-

1) Install and enable 'Php Shortcode' Module.

2) Go to Configuration > Content Authoring > Text Formats.

3)Find the input format you want to enable the shortcode for and click on Configure in that row.

4) Enable the shortcode filter Shortcodes.

5) Under Filter settings, check the checkbox next to 'Enable Php Code Shortcode'.

6) Save the settings.

You're done. Now If you go and create any custom block you would notice below the WYSIWYG editor is our helpful tip to users on how to use the php shortcode.

Php shortcode module demo

After saving the block, Here is the output:-

Php shortcode module sample output

Please try this module by downloading here and let us know if you have any questions.