avada.io
AVADA logo
Avada
Published on
Catalog

How to use API keys in Wordpress

553 words3 min read
Author
  • Author
    Author:
    ha-anh
    Twitter

Overview

What is API keys? An API code is "a code generated by websites that allow users to access their application programming interface. API keys are used to track how the API is being used in order to prevent malicious use or abuse of the terms of service." The simplest way to explain what an API is: a way to handle data somewhere other than where you are. A good example that is probably being used on many WordPress websites is a typical Twitter widget. Depending on the widget different API’s may be being used there, and it is displayed in different ways but no matter what way you do it what is happening is your website is using the Twitter API to retrieve and display tweets. However, API does not always mean connecting to an external website and getting data; you could be sending data, or you could even be working with data within your own website. When working with APIs in PHP you typically see cURL being used to connect to other servers to get or send data. cURL is great, except when the web server does not have cURL installed. So how do you make sure that your plugin or widget that uses APIs will work on as many of the varying server environments across the whole 30% of the internet WordPress powers? WordPress offers you a HTTP API that you can use to access other APIs! Instead of using cURL to send a GET or POST data, we use the wp_remote_get() or wp_remote_post() functions and simply pass in a URL and what data we want to send

It seems complicated, right? Do not worry, we will make things easier for you. But first, you will need an API code for a few things that need the use of API codes in WordPress.

Since November 2011, an API Key were no longer automatically assigned for new Wordpress.com accounts. Currently, just only when you active the Akismet service for blogs and sites which are not hosted on WordPress.com that you can use API keys. Askimet is one of the best ani-spam solutions available today.

WordPress.com is gradually phasing out use of the API keys.

How to get an API Key?

If you joined WordPress.com before November 2011, an API key was automatically attached to your WordPress.com Welcome Email. There is the circumstance that you have too many emails and cannot see your Welcome mail. But don not worry, you can search for that email if you printed or saved it in your inbox email.

Recently, an API key is not automatically attached to the welcome email anymore, in case you need an API Key to activate the Akismet service on your site or blog, you need to go to the Akismet site. In here, you can find many options and you are able to choose a plan and the API Key. Will be sent to you.

How about the WordPress.com Stats Plugin for Self-Hosted WordPress?

The company no longer let WordPress.com Stats plugin to be actively maintained. Furthermore, you should not utilize it on the new WordPress.com installations or for WordPress sites which is utilizing WordPress 3.3 or later.

WordPress.com Stats are now integrated into Jetpack plugin. Jetpack are recommended to be used for the new WordPress sites.

Exclusive Offer: Shopify Deal for PageFly Audience

Start Your Online Business with Shopify 12 Day Free Trial + Pay Only 1$ For Your First Month

Exclusive Offer: The Online Store Starter Kit

Get the Shopify Free Trial plus the premium package designed especially for new Shopify merchants - all for FREE!

What’s in it for you?

  • The Shopify free trial
  • Ecommerce CRO checklist: set up a high-converting Shopify store - with over 300+ checkpoints to boost your conversion rate, AOV, and more (value)
  • Enjoy 2 months free on all AVADA paid apps (value)
  • Exclusive discounts on top-rated Shopify apps and themes + Additional perks (value)

How can I get it?

The Online Store Starter Kit will be delivered to your email after signing up for Shopify using the custom landing page Shopify made for AVADA’s audience. There’s no additional cost for you!

Start your Shopify Free Trial now and get it for free!

Advertisement
img Advertisement