I’ve looked for a way to pull my site’s Akismet’s API key but I’m not seeing a solution when I search through the tag akismet. When I research the documentation on Key verification I add the function akismet_verify_key
but then I’m told I cannot re-declare it so I think it means the function is enabled in the plugin?
When I researched further I did find that I can define my API Key in my wp-config with:
// AKISMET API KEY
define('WPCOM_API_KEY','12345werty');
but when I try to use:
akismet_verify_key(WPCOM_API_KEY, site_url());
it works if I define WPCOM_API_KEY
but how can I get the API key after enabling the Akismet plugin without the constant in the config?
The closet questions I could find were:
- I should hide the API Key in a plugin?
- Does Akismet plugin expose any hooks, functions, class that can work with custom code?
but they didn’t answer my question. Is there a constant I should pass if I cant check for true
or false
to akismet_comment_check()
per the comment documentation?
EDIT:
Seems there is some confusion in my question. I was looking to know if there is a way after the plugin is activated by entering your API key how you can pull the API key from the plugin to use it in something else without having to manually modify the wp-config
as a constant with the key.