Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1418021
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionso i got this code
add_filter( 'abcdefg/json_ld', function( $data, $jsonld ) {
if ( is_single() ) {
$data['richSnippet']['articleBody'] = $jsonld->post->post_content;
}
return $data;
}, 11, 2);
I'm simply trying to take the post_content and basically deliver only the text, currently its adding WPbakery tags (E.G [vc_row],[vc_column_txt] and so on, and also the usual h1/2/3 and so on)
i can somewhat read PHP code, but no where near the level of writing code. i was trying to take the $data after the return and "proccess" it through wp_strip_tags and then i figured i should probably run $data before it returns.. that didnt work.
so here i am.. any tips? thank you!
also just to make sure, it is running on functions.php.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionso i got this code
add_filter( 'abcdefg/json_ld', function( $data, $jsonld ) {
if ( is_single() ) {
$data['richSnippet']['articleBody'] = $jsonld->post->post_content;
}
return $data;
}, 11, 2);
I'm simply trying to take the post_content and basically deliver only the text, currently its adding WPbakery tags (E.G [vc_row],[vc_column_txt] and so on, and also the usual h1/2/3 and so on)
i can somewhat read PHP code, but no where near the level of writing code. i was trying to take the $data after the return and "proccess" it through wp_strip_tags and then i figured i should probably run $data before it returns.. that didnt work.
so here i am.. any tips? thank you!
also just to make sure, it is running on functions.php.
Share Improve this question edited Jul 30, 2019 at 23:21 Tom J Nowell♦ 61.2k7 gold badges79 silver badges150 bronze badges asked Jul 30, 2019 at 23:02 Shay OhayonShay Ohayon 111 bronze badge 2- What is the jsonld and where does this filter come from? Your code example doesn't include any tag stripping functions so it's not clear how you're trying to use the function – Tom J Nowell ♦ Commented Jul 31, 2019 at 20:58
- It seems this is actual a RankMath SEO plugin question, you should contact RankMath SEO plugin support – Tom J Nowell ♦ Commented Aug 1, 2019 at 3:09
1 Answer
Reset to default 1Those aren't HTML tags, those are shortcodes. wp_strip_all_tags
will strip out HTML tags such as <p>
or <i>
. For shortcodes you should strip out the shortcodes
I did a quick google which turned up strip_shortcodes
on the official dev docs:
https://developer.wordpress/reference/functions/strip_shortcodes/
本文标签: seowpstripalltags
版权声明:本文标题:seo - wp_strip_all_tags 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745282677a2651516.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论