Where can I define shortcodes?

WordPress menu Tools > Shortcode Exec PHP

What happens when I disable a shortcode?

The shortcode will not be handled and will appear unprocessed.

Who can access the settings and the PHP code?

Users with manage_options (single user) or manage_network (multi user) capability (administrators).

Who can use the defined shortcodes?

Anyone who can create or modify posts, pages and/or widgets or can write comments. Shortcode execution in widgets, excerpts, comments and RSS feeds is disabled by default (unless another plugin or your theme does enable it). It is possible to restrict shortcode execution in posts and pages based on the capabilities of the post or page author (since version 1.18).

How are PHP errors handled?

Because the PHP eval function is used, errors cannot be handled unfortunately, so test your code thoroughly.

How many shortcodes can I define?


I get a blank page when I use a shortcode on a large post/page

This can happen if the PCRE backtrack value is too low. Try increasing it using the plugin settings.

Where are the shortcode definitions stored?

The shortcode name, options and PHP code are stored as WordPress options.

How can I change the styling of the settings?

  1. Copy shortcode-exec-php.css to your upload directory to prevent it from being overwritten by an update
  2. Change the style sheet to your wishes; the style sheet contains documentation

How do I test a shortcode with parameters?

Indirectly, by using default values.

Should I use PHP opening and closing tags?

No, omit both <?php and ?>.

Can I embed HTML code?

Yes, if you enclose the HTML code with ?> and <?.

My shortcode appears with a question mark behind it

The post or page author has insufficient privileges to execute shortcodes.

I get ‘Warning: … in … : eval()’d code on line xxx’

This means there is an error in your shortcode definition on line xxx.

My code doesn’t work!

Note that your code is not directly executed in the WordPress environment, but in a function. This means for example that a global $wpdb; is needed to access the database class.

Where can I ask questions, report bugs and request features?

This plugin is not supported anymore