Home Forums Event Espresso Premium ld+json Event Description displays shortcodes

ld+json Event Description displays shortcodes

Posted: March 9, 2020 at 3:54 pm


March 9, 2020 at 3:54 pm

The issue I am having is that I have to use shortcodes to display dynamic content on our events and when this is output through the ld+json Schema Data it outputs the Shortcode instead of executing and then displaying.

Is there a workaround that I can use to make this work. Is there a hook or snippet of code that I can use to make it execute the shortcode before outputting the description.

Thanks again,


  • Support Staff

March 9, 2020 at 4:06 pm


There is a filter hook:


here’s a link to its source on GitHub for your reference:


March 16, 2020 at 1:22 pm

Sorry I am still a bit of a beginner when it comes to this. Can you provide an example of using this to modify the description.

Thanks again for the awesome support.


  • Support Staff

March 19, 2020 at 4:02 pm


At a minimum you’re looking to replace this:
$template_args['event_description'] = wp_strip_all_tags($event->short_description(200));

with something like this:

$template_args['event_description'] = wp_strip_all_tags($event->description_filtered());

So your code will look like this:

function my_custom_json_linked_data_function(
) {
    $template_args['event_description'] = wp_strip_all_tags(
    return $template_args;

You can add the above to a functions plugin or, if available, into your WordPress child theme’s functions.php file.

Since I do not know what your shortcode outputs, there’s a possibility that something output by the shortcode should not be included within ld+json markup. It’d be good to check using the structured data testing tool.

Please also note that Google only shows a snippet of the full description.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Josh 1 week, 3 days ago ago

Topic Tags


This topic is: not resolved
Do NOT follow this link or you will be banned from the site!