Excluding Shortcodes & Keywords [FIX]
-
It looks as though the developer has taken a break so we had to fix this ourselves. its such a great SO plugin we couldnt not keep using it.
If like us you often use themes that have shortcodes to make stuff or use WordPress Bakery’s Visual Composer you will find that your top keywords end up being “columns” or “accordian” and other such similar words. This because the plugin tries to keep the contents of shortcodes as best as possible. However we have foudn that most of the time our keywords never actually get between the sqaure brackets like below.
[shortcode="details"]The content is then here[/shortcode-end]
The way to exclude shortcodes being picked up is a simple fix.
1) Open the plugin file basic-string-tools.php
2) Find this around line 127
# Strip HTML tags without gluing words. We assume the HTML is not encoded into entities. function bst_html_stripper ( $text ) { $search = array( '@<script[^>]*?>.*?</script>@si', # Strip out javaScript '@<[\/\!]*?[^<>]*?>@si', # Strip out HTML tags '@<style[^>]*?>.*?</style>@siU', # Strip style tags properly '@<![\s\S]*?--[ \t\n\r]*>@' # Strip multi-line comments including CDATA
3) Add this line after the Strip out HTML tags.
'@[[\/\!]*?[^\[\]]*?]@si', # Remove shortcodes for common shortcode patterns.
4) It should now look like this.
# Strip HTML tags without gluing words. We assume the HTML is not encoded into entities. function bst_html_stripper ( $text ) { $search = array( '@<script[^>]*?>.*?</script>@si', # Strip out javaScript '@[[\/\!]*?[^\[\]]*?]@si', # Remove shortcodes for common shortcode pattern such as Visual Composer '@<[\/\!]*?[^<>]*?>@si', # Strip out HTML tags '@<style[^>]*?>.*?</style>@siU', # Strip style tags properly '@<![\s\S]*?--[ \t\n\r]*>@' # Strip multi-line comments including CDATA
5) Go to word stats on the dashboard and hit refresh. It may not be immediate but it does work.
- The topic ‘Excluding Shortcodes & Keywords [FIX]’ is closed to new replies.