View Categories

Stop Logtivity From Recording Log Types

It is possible to stop Logtivity from recording specific types of logs. For example, you may not want to record a log every time a post is updated.

In that situation, you can use this code snippet to stop “Post Updated” logs from being recorded by the Logtivity app:

add_action('wp_logtivity_instance', function($Logtivity_Logger) {

    $actionsToIgnore = [
        'Post Updated', // add as many actions as you would like to ignore to this array
    ];

    if (in_array($Logtivity_Logger->action, $actionsToIgnore)) {
        $Logtivity_Logger->stop();
    }

});