• Resolved tezalsec

    (@tezalsec)


    Hi,

    is there any way to hide the message in the profile page “Application password is disabled by Wordfence” ?

    I don’t want my users to see this text including the preceding label. I don’t see any simple specific css handle on the table it is in that I can apply “display:none” to.

    Thank you.

    Cheers.

    • This topic was modified 2 years, 4 months ago by tezalsec.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @tezalsec

    Thanks for reaching out!

    Unfortunately, at this moment is not possible to hide this message from users through CSS or through the app itself.

    I have passed this over to the developers to look into this issue.

    Unfortunately, we cannot guarantee a timeline for this to be implemented yet.

    What you can do is try and implement it through Javascript. You can add this Jquery below:

    jQuery('h2:contains("Application Passwords")').hide();
    jQuery('h2:contains("Application Passwords")').next().hide();

    You may want to only run these two lines on the users’ profile page.

    Another option is to disable the feature entirely by adding something like this to the function.php file:

    add_filter('wp_is_application_passwords_available', '__return_false');

    Please let me know if you have any other questions and I will be happy to help!

    Thanks,

    Joshua

    Thread Starter tezalsec

    (@tezalsec)

    Hi Joshua,

    thank you for your solution. The Jquery works perfectly 🙂

    the add_filter code does not work, it disables the function, but does not remove your “disabled” message there.

    Great that your developers are gonna look at it. It would help if the h2 and table elements would at least have a unique class so people can hide it with simple css.

    Cheers.

    @tezalsec

    Simply disable the option in WordFence All Options Settings “Disable WordPress application passwords”. This will remove the message that is added by WordFence.

    Now if you don’t want to use the WordPress feature “Application Passwords” just add this code in your child theme functions.php & it will disable it.

    /**
     *
     * Disable Application password feature by WordPress
     *
     */
    
    add_filter('wp_is_application_passwords_available', '__return_false');
    Thread Starter tezalsec

    (@tezalsec)

    Thanks @jimi007 for the help, but that is not what this post is about.

    Even after using the filter and disabling in Wordfence, the message ‘Application password is disabled by Wordfence’ is still shown in the profile. It is this message I wanted to hide.

    Check out the above response from the Wordfence employee wfjoshc, he confirms the issue, offers a JS solution which I now use (besides the filter and disabled options), and has communicated it to their developers to deal with this in a cleaner way, or at least include some unique css class to be able to hide it.

    @tezalsec I think you have some type of caching enabled. Because disabling the option of “Disable WordPress application passwords” will remove/hide the WordFence message from the user profile page. I have tested this in 3 different sites on different servers.

    Actually enabling this option in Wordfence do two things
    1- Disable the “Application password” feature by WordPress
    2- Display the message on the user profile

    Please try clearing cache from any plugin installed & any caching in the server.

    This is the code that is responsible for adding the message
    https://plugins.trac.wordpress.org/browser/wordfence/trunk/lib/wordfenceClass.php#L1272

    if (wfConfig::get('loginSec_disableApplicationPasswords')) {
    add_filter('wp_is_application_passwords_available', '__return_false');
    add_action('edit_user_profile', 'wordfence::showDisabledApplicationPasswordsMessage', -1);
    add_action('show_user_profile', 'wordfence::showDisabledApplicationPasswordsMessage', -1);
    • This reply was modified 2 years, 1 month ago by Jamil Ahmed.
    • This reply was modified 2 years, 1 month ago by Jamil Ahmed.
    RT_PDX

    (@ronald2020)

    Add the following two lines to your functions.php file

    remove_action(‘edit_user_profile’,’wordfence::showDisabledApplicationPasswordsMessage’,-1);
    remove_action(‘show_user_profile’,’wordfence::showDisabledApplicationPasswordsMessage’,-1);

    Currently, the only way to disable this message is to uncheck “Disable WordPress application passwords” and install a plugin that disables the application passwords, such as Disable Application Passwords. In the meantime wordfence developers can try to find a more elegant solution for those of us who are not familiar with programming or scripts 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Hide “disabled application password” in profile’ is closed to new replies.