• Resolved lozula

    (@lozula)


    Hello,

    Version 5 of Akismet introduces a new feature which “Added a new feature to catch spammers by observing how they interact with the page.”

    This loads an extra javascript. I was happy with the performance before and am not interested in this feature. Please advise how to disable it so as not to load an extra unneccessary script.

    Thanks

    Laurence

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    If you want to achieve this immediately, you should be able to leverage WP’s remove_action() on those two , and remove_filter() on this one .

    We’ll discuss the potential to provide other ways to achieve the same in the future.

    I don’t know if I am doing it wrong but removing the mentioned actions and filters did not skip loading akismet-frontend.js for me. I really do not want loading javascript on my site.

    There is also one inline script added by akismet which prevents us from implementing strict Content Security Policy (we need to have unsafe-inline rule because of it):

    <script>document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() );</ script>

    Hi Laurence,

    Try adding this in mu-plugins; it worked on my site. It should remove both the new JavaScript file and the inline JavaScript, but the usual caveat applies that it may negatively affect spam-catching accuracy on your site.

     <? php add_action( 'init', 'remove_akismet_frontend_js', 99 ); function remove_akismet_frontend_js() { remove_action( 'comment_form', array( 'Akismet', 'load_form_js' ) ); remove_action( 'do_shortcode_tag', array( 'Akismet', 'load_form_js_via_filter' ) ); remove_action( 'comment_form', array( 'Akismet', 'output_custom_form_fields' ) ); }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to disable interaction observing in version 5’ is closed to new replies.