0

When WordPress is installed, it sends a notification

New WordPress Site
Your new WordPress site has been successfully set up at:
...

I would like to change the text of the e-mail but am not successfull. Here is what I tried:

I added the following code to the main file of a plugin which I add before the installation

function changed_install_mail($installed_email, $user, $blog_title, $blog_url, $password ) {
    $installed_email['subject'] = 'test';
    return $installed_email;
}
add_filter( 'wp_installed_email', 'changed_install_mail', 10, 5 );

I tried to play around with the priority, but the filter never gets added. But other code in this plugin file is executed.

This filter gets applied in upgrade.php

$installed_email = apply_filters( 'wp_installed_email', $installed_email, $user, $blog_title, $blog_url, $password );


Maybe it's the wrong time or wrong location I'm trying it?

2 Answers 2

2

I found a solution: mu-plugins. My code isn't executed in this early state, but that's what mu-plugins are for. https://wordpress.org/support/article/must-use-plugins/ This did the trick.

0

just an opinium, each wordpress plataform is only instaled one time, and each time only the email registered will receive the email. Not my business, but isnt this worthless, if the person is installing wordpress, he knows the wordpress is being installed. if some other email is being their instead of the one who is installing it, why just not send a personal email giving the information. Also if you personalize one wordpress files to do so, you will need to use that files always you install a new wordpress. Also update your files each time wordpress has a new release/update. I must confess, I have installed a few and never had receive such email. And for the email to work always had to put some code on the theme functions.php

1
  • 1
    Thank you for your opinion! I found a solution, I'll post it later. I am working with plesk and wp-toolkit. I also haven't seen this e-mail before, but recently also got it while I installed wp via wp-cli on a vps. The problem in my case is, that the e-mail is english, which is not suitable for all my customers. The main problem is, that the core is installed in english, which is done by plesk, and that's not changeable. If the core would be downloaded in the provided language, the mail also would be in that language.
    – parvaneh
    Commented Nov 12, 2021 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.