Title: Filter errors
Last modified: January 19, 2024

---

# Filter errors

 *  Resolved [maxence1502](https://wordpress.org/support/users/maxence1502/)
 * (@maxence1502)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/filter-errors/)
 * Hello,
 * I’d like to ignore all the errors on the site and keep only the errors in my 
   theme and plugin. So I tried your code: [https://github.com/stayallive/wp-sentry/tree/v7.3.1?tab=readme-ov-file#capturing-errors-only-from-certain-theme-andor-plugin](https://github.com/stayallive/wp-sentry/tree/v7.3.1?tab=readme-ov-file#capturing-errors-only-from-certain-theme-andor-plugin)
 * 
   Which didn’t really work as I’d hoped.
 * So I tried to check whether the filter worked like this:
 *     ```wp-block-code
       add_filter( 'wp_sentry_options', function ( \Sentry\Options $options ) {
           $options->setBeforeSendCallback( function ( \Sentry\Event $event ) {
               error_log( "DEBUG SENTRY : HOOK" );
               return null;
           } );
   
           return $options;
       } );
       ```
   
 * If I’m not too stupid, it shouldn’t log any errors in Sentry. However, most of
   them are ignored, but not all: [https://prnt.sc/IsOC-DmjsSyM](https://prnt.sc/IsOC-DmjsSyM)
 * How do you explain this?
    -  This topic was modified 2 years, 4 months ago by [maxence1502](https://wordpress.org/support/users/maxence1502/).
    -  This topic was modified 2 years, 4 months ago by [maxence1502](https://wordpress.org/support/users/maxence1502/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [stayallive](https://wordpress.org/support/users/stayallive/)
 * (@stayallive)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/filter-errors/#post-17383808)
 * Sorry for the late reply, this one fell through the cracks. Did you end up figuring
   it out?
 * Some of these errors look very much like JavaScript errors… is it possible you
   also enabled the `WP_SENTRY_BROWSER_DSN` because the `wp_sentry_options` filter
   only works for the PHP side and not the browser side.
 * Could that be the cause?

Viewing 1 replies (of 1 total)

The topic ‘Filter errors’ is closed to new replies.

 * ![](https://ps.w.org/wp-sentry-integration/assets/icon-256x256.jpg?rev=1772463)
 * [Sentry for WordPress](https://wordpress.org/plugins/wp-sentry-integration/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-sentry-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-sentry-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-sentry-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-sentry-integration/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [stayallive](https://wordpress.org/support/users/stayallive/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/filter-errors/#post-17383808)
 * Status: resolved