Hi @gudrunpetz
Thanks for your question and I hope I have understood correctly, does your snippet add[advertisement] dynamically using a filter like the_content? if so it may not appear in previews or search snippets because:
By default, Code Snippets executes code within your WordPress environment, but post previews and Google search snippets depend on how WordPress and search engines process content.
- Post previews might not fully process all filters.
- Google snippets are based on cached and indexed content, which may take time to update.
A possible workaround is to ensure the tag is added directly to the post content at the time of saving using a filter like the_content
If you want it to appear in search results, consider adding the text within the actual post content manually or using an SEO plugin to customize meta descriptions.
Hope this helps.
Thread Starter
gudrun
(@gudrunpetz)
Hello, I manually insert the word [ad] at the beginning of the text. However, the snippet display only shows [snippetxxx] but not the content.
The text in the post preview is not displayed, even though the word is inserted.