the problem is that if the Divi Builder use a not standard way I cannot strip shortcodes because to do this the only way is to parse the all text with some regex and itβs not a safe solution for me..
I agree with @lando1982: the main content is just not a safe bet to use in the search results. It can get crowded with shortcodes and code which is too complexed to convert to plain text.
This is why I recommend using other plain text fields like Excerpt or Yoast Meta Description.
I like that idea. How do I get the Yoast Meta Description to display?
Hi Dave,
in the “Custom field types prefix/suffix” field in the “Other settings” of the settings page you should add “_yoast” to the list in order to view the Yoast fields in the “Field types” items in the “Schema settings” section. Then, look for “_yoast_wpseo_metadesc” and “check” it to sync it to CloudSearch.
After that you have to go to manage page and run an “Create/update index” and a “Run indexing” to add the field to the CloudSearch index.
Now you can sync all documents to add the Yoast description values to the CloudSearch documents.
Finally, if you use the “Plugin based” template, in the “Results settings” add the custom field “_yoast_wpseo_metadesc” to the “Showed fields
(for posts)” in order to show it.
Should work π
Bye