Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Så här inaktiverar du email med borttappat/changed password i WordPress

Vill du lära dig hur du inaktiverar email med borttappat/ändrat password i WordPress?

Som standard skickar WordPress automatiskt ett email till WordPress-administratörer när någon annan användare återställer sitt password med hjälp av länken för förlorat password. Dessa email kan snabbt bli irriterande om din site har många användare.

I den här artikeln visar vi dig hur du inaktiverar aviseringar om förlorat/changed password i WordPress.

How to disable lost/changed password emails in WordPress

Varför inaktivera email med borttappat/changed password i WordPress?

Som standard gör WordPress det enkelt för användare att återställa sina lösenord. De kan helt enkelt heada över till WordPress vy för login och clicka på länken ”Lost your password?”.

Resetting your WordPress password

Varje gång en användare återställer sitt password skickar WordPress ett email till din site admin.

Dessa meddelanden kan hjälpa dig att upptäcka misstänkt aktivitet, inklusive hackare som kan bryta sig in i en användares account genom att ändra lösenordet.

The WordPress password reset email

Dessa email med borttappat/changed password kan dock bli irriterande om du är en site admin och tillåter registrering av användare på din WordPress website. Detta gäller särskilt om du run en membership site eller en store med många registrerade customers.

Med detta sagt, låt oss ta en titt på hur man inaktiverar e-postmeddelanden om förlorat/ändrat password i WordPress. Använd bara snabblänkarna under för att hoppa direkt till den metod du vill använda:

Metod 1: Inaktivera email med borttappat/changed password i WordPress (ingen kodmetod)

Den här metoden rekommenderas för alla Beginner eftersom den inte kräver att du rör någon kod.

Det enklaste sättet att inaktivera e-postmeddelanden om förlorat/ändrat lösenord i WordPress är att använda pluginet WP Mail SMTP Pro.

WP Mail SMTP är det bästa tillägget för SMTP för WordPress på marknaden. Över 3 miljoner webbplatsägare använder WP Mail SMTP för att förbättra sin email deliverability och fixa WordPress not sending email issue.

WP Mail SMTP låter dig också kontrollera vilka WordPress email som skickas ut, så att du selektivt kan inaktivera de som du vill ha. Dessa inkluderar automatiska aviseringar om updating och emailet ”Password Changed”.

Note: Det finns också ett gratis WP Mail SMTP plugin som omkonfigurerar WordPress för att använda en korrekt SMTP provider när du skickar emails. Detta gratis plugin låter dig dock inte inaktivera emailet ”Password Reset”, så vi kommer att använda premium-pluginet i den här guiden.

När du har köpt pluginet WP Mail SMTP klickar du bara på tabben ”Downloads” i ditt WP Mail SMTP account.

You can then click on the ”Download WP Mail SMTP” button to download the plugin to your computer as a ZIP file.

Downloading the WP Mail SMTP plugin

Därefter rullar du helt enkelt till ”License key” section. Du behöver den här nyckeln för att aktivera ditt plugin, så det är en bra idé att hålla denna page öppen.

När du har gjort det måste du uploada ZIP-filen till din WordPress website och aktivera WP Mail SMTP plugin. För mer detaljer, vänligen se vår guide om hur man installerar ett plugin för WordPress.

Efter aktivering, gå till WP Mail SMTP ” Settings.

You can now either type or copy/paste your WP Mail SMTP license key into the ”License Key” field. När du har gjort det klickar du bara på knappen ”Verify Key”.

The WP SMTP license key field

Efter att ha kontrollerat din license key, head över till WP Mail SMTP ” Settings.

Du kan sedan gå vidare och klicka på tabben ”Email Controls”.

The WP SMTP plugin's email controls

På den här page ser du all email som WordPress skickar automatiskt.

För att inaktivera e-postmeddelandet om förlorat / ändrat lösenord, rulla bara till ”Change of User Email or Password” section.

How to disable the WordPress password reset emails

Hitta sedan slidern ”Password Reset Successfully” och ge den ett click. Detta kommer att vända slidern från ”På” till ”Av”.

Nu kommer du inte att få ett email varje gång en användare ändrar sitt password.

WP SMTP's password reset settings

Metod 2: Inaktivera email med borttappat/changed password i WordPress (kodmetod)

Om du inte vill konfigurera ett SMTP-plugin kan du inaktivera e-postmeddelanden om återställning av lösenord genom att lägga till kod i din WordPress-blogg eller website.

Det är där WPCode kommer in i bilden.

Detta gratis plugin gör det enkelt att add to custom CSS, PHP, HTML och mer till WordPress utan att riskera din site. Du kan helt enkelt klistra in plugin-koden i WPCodes editor och sedan aktivera och deactivate koden med ett klick på en knapp.

Genom att använda WPCode kan du också updating din WordPress tema utan att förlora customize.

Till att börja med måste du installera och aktivera WPCode. För mer information, se vår Step-by-Step guide om hur du installerar ett tillägg till WordPress.

Därefter går du till Code Snippets ” Add Snippet i WordPress dashpanelen.

Adding custom code to your WordPress website

Here, you’ll see all the pre-made snippets you can add to your site. Dessa inkluderar ett snippet som allow you att helt inaktivera comments, upload file types that WordPress doesn’t usually support, disable attachment pages, and much more.

I det här fallet finns den kod vi vill använda ej i listan över Pre-Made snippets. Vad du behöver göra är att hovera musen över ”Add Your Custom Code” och sedan välja ”Use snippet” när det visas.

Adding custom PHP to your WordPress blog or website

Till att börja med skriver du in en titel för det customze snippet. Det kan vara vad som helst som hjälper dig att identifiera koden i din WordPress dashboard.

Öppna sedan dropdown-menyn ”Code Type” och välj ”PHP”.

How to disable password reset notifications using WPCode

Följ detta genom att klistra in följande snippet i code snippets editor:

remove_action( 'after_password_reset', 'wp_password_change_notification' );

Under kodboxen ser du några alternativ för insert. Det finns två huvudalternativ: Auto Insert och Shortcode (standard).

Om det inte redan är valt, klicka sedan på ”Auto Insert”, WPCode kommer då automatiskt att insert och köra koden över hela din online store, website eller blogg.

Inserting a code snippet across your website or blog automatically

När det är gjort kanske du vill lägga till taggar i code snippet.

Detta kan hjälpa dig att organisera dina code snippets efter ämne och funktionalitet.

Adding tags to a custom code snippet

När du är redo att publicera PHP snippet, rulla till högst upp på vyn och klicka på ”Inaktiverad” toggle så att den ändras till ”Aktiv”.

Slutligen klickar du på ”Save Snippet” för att göra snippet live.

How to disable the password reset emails for WordPress admins

WordPress kommer nu att sluta skicka aviseringar om återställning av lösenord till din administratörs email address.

Experttips för att hantera aviseringar i WordPress

Om du run en multi-auteurisering eller en medlemskap webbplats, kan du bombarderas med email notifications om nya användare registreringar, kommentarer och annan webbplats aktivitet.

Vissa av dessa aviseringar är viktiga, medan andra bara överflödar din inbox.

Kontrollera dessa tutorials för att bättre hantera dina WordPress aviseringar:

Vi hoppas att den här artikeln hjälpte dig att lära dig hur du inaktiverar email med borttappat/changed password i WordPress. Du kanske också vill kontrollera vår ultimata säkerhetsguide för WordPress eller se vår tutorial om hur man skapar ett nyhetsbrev via email.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

22 kommentarerLämna ett svar

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    WP Mail SMTP is a great plugin, but unfortunately, I’m only using the free version. I’ve now deployed the MemberPress plugin on my website and want to launch the membership section. The snippet is great because it’s quick and easy. Additionally, it works in WP Code lite, which I’m currently using. Thank you for offering such functional instructions that are available at no cost. That’s what I appreciate about this website.

  3. Deivid says

    Tried adding this via a code snippet, as explained is possible in the article. But still getting notification emails?

    • WPBeginner Support says

      Depending on the code snippet plugin, ensure the specific snippet is enabled as the most common reason the snippet would not be working.

      Administratör

  4. David says

    Hello Good day wpbeginners, I tried using code snippet plugin, then placing the codes but I get an error saying
    ”The snippet has been deactivated due to an error on line 3: Cannot redeclare function wp_password_change_notification”.

    Please I need a solution to this. Thanks

    • WPBeginner Support says

      For the method in this article, you would need to add it as a custom plugin and not using an additional plugin for it to work.

      Administratör

  5. Marc says

    Thank you so much, so many emails and thus energy wasted nowadays, that could be saved with 3 lines of code.. thank you!!

    • WPBeginner Support says

      Glad our guide was helpful, while not the solution for every site we’re glad this could be something useful to you :)

      Administratör

  6. Christopher Simmons says

    Thanks for this, was resetting some of my author passwords simply for security, and they started complaining why they were getting emails about it when they no longer write for my publication — doh. This would have helped there, and now it’s in place in our ”extension plugin” we put all our hacks into. :-)

    THANK YOU!

  7. Marie Jac says

    Hi!

    I am trying to remove the notification sent to the user himself when reset his password (because an email is already sent by another customer plugin). The code above seems to only remove notification to admin. Is there another code I can use?

    Thank you!!

  8. Guido says

    There is an hook for that.
    Simply add this line of code

    remove_action( 'after_password_reset', 'wp_password_change_notification' );

  9. Fábio Tojal says

    Hi there,

    I am having problem! When I click on Reset Password nothing Happens! It stays in the same page!

    Do you know what is happenig ?

    Thanks!

  10. Steve Barman says

    The plugin generated 4 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin. – I hope this isn’t anything to worry about

  11. John Dough says

    Another option is to filter all emails from change password to the trash. In GMail you can setup a filter by opening the email and then somewhere along the top is a list of options. One is filter messages like these. Follow the onscreen instructions and send them to the trash.

  12. Bajza Ferenc says

    Hi,

    I found better solution for solve this problem without plugin.

    Backup your wp-includes/pluggable.php
    Edit wp-includes/pluggable.php file
    Find wp_password_change_notification part
    Delete these lines from file:

    if ( !function_exists(’wp_password_change_notification’) ) :
    /**
    * Notify the blog admin of a user changing password, normally via email.
    *
    * @since 2.7.0
    *
    * @param object $user User Object
    */
    function wp_password_change_notification(&$user) {
    // send a copy of password change notification to the admin
    // but check to see if it’s the admin whose password we’re changing, and skip this
    if ( 0 !== strcasecmp( $user->user_email, get_option( ’admin_email’ ) ) ) {
    $message = sprintf(__(’Password Lost and Changed for user: %s’), $user->user_login) . ”\r\n”;
    // The blogname option is escaped with esc_html on the way into the database in sanitize_option
    // we want to reverse this for the plain text arena of emails.
    $blogname = wp_specialchars_decode(get_option(’blogname’), ENT_QUOTES);
    wp_mail(get_option(’admin_email’), sprintf(__(’[%s] Password Lost/Changed’), $blogname), $message);
    }
    }
    endif;

    Save.

    Enjoy.

  13. Pam Blizzard says

    Exactly what I wanted to know – and I thought putting a snippet in functions.php was the best way to go, but I’m so glad you mentioned that it wouldn’t work. THANK YOU!

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.