This documentation is only valid for older versions of Wordfence. If you are using Wordfence 7 or later, please visit our.
Wordfence includes a public function that can be called by any developer from within WordPress. The function is:
Where $token contains a token that you were given when you used the option to export your Wordfence settings.
This function lets you import Wordfence settings on potentially thousands of WordPress sites without manually having to sign-into those websites and do the import manually on each site.
Simply install Wordfence on each site and make sure it's activated. Then execute this function making sure that you pass the correct token to it as a string and the function will make an API call to Wordfence servers and import the settings you saved.
Remember to keep your token secure because it is like a password and if anyone else gets access to this token they will be able to import your Wordfence settings (excluding your API key) into their own website.