Use the 'String watch' for this string
field to define a string to be watched for.
This may help you find where output is being produced. It could be from WordPress, a plugin, the theme or your content.
Sample trace output
When the string is detected the routine produces a trace record and a backtrace.
wp-content/plugins/oik-bwtrace/includes/bwtrace-stringwatch.php(79:0) bw_trace_stringwatch_filter(2) 237 0 2019-12-05T16:52:55+00:00 0.343496 0.000237 cf=the_content 9695 34 3254 6291456/6291456 256M F=584 stringwatch! default output handler,bw_trace_output_callback <p>Stick to 0. bw_lazy_backtrace wp-content/plugins/oik-bwtrace/libs/bwtrace.php:108 0 1. bw_backtrace wp-content/plugins/oik-bwtrace/includes/bwtrace-stringwatch.php:80 0 2. bw_trace_stringwatch_filter(<!-- wp:paragraph --> <p>Stick to the top of the blog.</p> <!-- /wp:paragraph -->,the_content,filter) wp-content/plugins/oik-bwtrace/includes/bwtrace-stringwatch.php:56 3 3. bw_trace_stringwatch(the_content,<!-- wp:paragraph --> <p>Stick to the top of the blog.</p> <!-- /wp:paragraph -->) wp-includes/class-wp-hook.php:334 2 4. do_all_hook(array) wp-includes/plugin.php:877 1 5. _wp_call_all_hook(array) wp-includes/plugin.php:189 1 6. apply_filters(the_content,<!-- wp:paragraph --> <p>Stick to the top of the blog.</p> <!-- /wp:paragraph -->) wp-includes/post-template.php:253 2 7. the_content(Continue reading <span class="meta-nav">→</span>) wp-content/themes/twentyeleven/content.php:41 1 8. require(C:\apache\htdocs\wordpress\wp-content\themes\twentyeleven\content.php) wp-includes/template.php:724 1 9. load_template(C:\apache\htdocs\wordpress/wp-content/themes/twentyeleven/content.php,) wp-includes/template.php:671 2 10. locate_template(array,1,) wp-includes/general-template.php:168 3 11. get_template_part(content,) wp-content/themes/twentyeleven/index.php:30 2 12. include(C:\apache\htdocs\wordpress\wp-content\themes\twentyeleven\index.php) wp-includes/template-loader.php:98 1 13. require_once(C:\apache\htdocs\wordpress\wp-includes\template-loader.php) wp-blog-header.php:19 1 14. require(C:\apache\htdocs\wordpress\wp-blog-header.php) index.php:17 1
It then attempts to return the results of the stringwatch to the browser, when it’s safe to do so.
<div class="stringwatch">String watch detected: <p>Stick to In: the_content filter After: gettext filter </div>
Limitations
You may not see the output in your browser, but you should be able to find it using View Source.
- The ‘stringwatch’ routine only reports the first instance of the string.
- This functionality is not available for batch processing.