Hi,
can you paste the value of your custom field in <code> tag here please?
Thx
Thread Starter
ikke77
(@ikke77)
Hello Benjamin,
Off course, I use multiple for different pages, but below two examples:
%%_cf_lan_english_txt%%
%%_cf__description-se%% %%_cf__description-en%%
Extra info regarding the last: sometimes the Swedish description is not available, so it will then use the English.
Thank you for your feedback but I meant the final value, the one in the source code.
Thread Starter
ikke77
(@ikke77)
Haha, you meant that code 🙂
That’s like this:
<meta name="description" content="<p>Just random text</p> <p>Another text...<p>">
or
<meta name="description" content="<p>Just <strong>random</strong text</p> <p>Another text...<p>">
Can you confirm you’re seeing something like this in your source code:
<meta name="description" content="test <p>zzzzzzz</p>">
Thread Starter
ikke77
(@ikke77)
Hello Benjamin,
Yes, i see that, all is working, but it includes the html tags ( p strong br etc) from the %% custom field %%
But it doesn’t include the characters as you mentioned:
<p>zzzzzzz</p>
It just says: <p>zzzzzzz</p>
-
This reply was modified 3 years ago by
ikke77.
OK, so currently this is not possible to act on this.
But, we’ll add a hook in a future update to filter this.
ETA: June/July
Thread Starter
ikke77
(@ikke77)
Thank you Benjamin, have a nice weekend! 🙂
If you want to remove HTML and HTML entities from meta description you can use this filter:
function sp_titles_desc($html) {
return strip_tags(html_entity_decode($html));
}
add_filter('seopress_titles_desc', 'sp_titles_desc');
See https://www.seopress.org/support/hooks/filter-meta-description/