-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wordpress: Shortcodes/scripts in Posts render output in search results #868
Comments
@neosin yes shortcodes will be rendered when doing the indexing. so the search results will output rendered content as a whole. |
We apply the ElasticPress/classes/class-ep-api.php Line 586 in d289983
|
We use shortcodes to display video with jwplayer and add json schema data. The issue we are running into is that the schema data is being indexed and displayed. The video player is being removed as expected but the schema data is not. We are not sure how to remove it. The javascript json tags are being removed but the schema data between the tags is not. Any suggestions of how to remove the data between the tags? |
so this is a bug? |
Yes it supposed to have script tags inside the content indexed. |
I've run into this issue myself. While the surrounding script tags are stripped by |
Hi @dosmoc You can filter the
|
@neosin closing this as it appears to have an answer. Feel free to re-open if you've got a follow-up! |
Looking over this again I'd agree that we want to exclude any JS content (not just the tags themselves) in a situation like this. Looks like instead of strip_tags() we can call https://developer.wordpress.org/reference/functions/wp_strip_all_tags/. |
ElasticPress 3.0 changed this a bit and then ElasticPress 4.0 added yet another change related to this. Currently, on a website with Instant Results enabled, these three fields are indexed for a specific post:
That means that:
As some custom solutions may be relying on , and , for example), any adjustment on that would be a breaking change. We could bring |
The explanation and the table were added to https://elasticpress.zendesk.com/hc/en-us/articles/4402857301389. |
Shortcodes/scripst in Posts render output in search results.
When searching posts and if the post contains a shortcode or script tag, the source of those are rendered in the search results.
is this a bug or a setting that needs to be set somewhere?
The text was updated successfully, but these errors were encountered: