How to Use Akismet on WordPress Multisite with 1 License Key

How to Use Akismet on WordPress Multisite with 1 License Key

akismet-square

Millions of sites depend on the Akismet service for blocking the never-ending flood of comment spam targeted at WordPress. Today we have a handy tip for WordPress multisite super admins that should save you quite a bit of time in the future.

Did you know that you can actually hard code your WordPress.com API key into your config file so that it works for your entire multisite network?

There is a little note at the top of the akismet.php file that says:

/** If you hardcode a WP.com API key here, all key config screens will be hidden */

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

Hiding all of the key config screens is a beautiful thing! It makes life easier for all of the admins on your network.

Here’s how to do it:

Open up your wp-config.php file. Find the line that says “That’s all, stop editing! Happy blogging.” Add this constant below and replace ‘your-key’ with your WordPress.com API key:

{code type=php}
/** Define WordPress.com API Key */
define(‘WPCOM_API_KEY’,’your-key’);

Save it and re-upload. That’s it! So easy, right?

This keeps you from requiring each blog owner to have his own license key or having to add your key over and over again.

Please note that you still need to make sure to “Network Activate” the plugin so that it is applied to all blogs across your network.

This is one tip that you’ll want to apply to all of your multisite installations that depend on Akismet for protection from comment spam.

Tags: