Wordpress is the most widely used platform to build websites across the globe. From small blogs to full-fledged eCommerce websites, Wordpress provides the flexibility to build different kinds of websites with minimal technical effort.
You can easily integrate ImageKit.io in your WordPress website using our official WordPress plugin.
Feature | Available |
---|---|
Serve images in next-gen formats |
Yes |
Automatic image optimization |
Yes |
Automatic image resizing |
No |
Lazy loading images | No |
Here is what you need to do:
Configure origin based on where your images are stored. For example, Amazon S3 bucket origin or web server.
Let's quickly fetch the image using ImageKit.io URL-endpoint and see if it's working.
When you add the first origin in your account, it automatically becomes accessible through the default URL-endpoint, that is https://ik.imagekit.io/your_imagekit_id
. Otherwise, you will have to configure an existing URL endpoint or create a new one to fetch images from this newly added origin.
If your old image URL was https://www.example.com/wp-content/uploads/image.jpg
, then the same image should be accessible through ImageKit.io URL-endpoint, i.e., https://ik.imagekit.io/your_imagekit_id/wp-content/uploads/image.jpg
- Install and activate ImageKit.io WordPress plugin.
- Go to Settings:arrow_right:ImageKit.io setting.
- Fill the ImageKit URL endpoint (or CNAME) with
your_imagekit_url_endpoint
. Copy and paste from the ImageKit.io dashboard. - Click "Save changes" button.
- Flush cache, if any.
{% hint style="success" %} Now all the image files under theme directory on your WordPress site (with extensions matching one of gif, png, jpg, jpeg, bmp, ico, webp) will be loaded via ImageKit.io. {% endhint %}
By default, ImageKit.io plugin is configured to load only image files through ImageKit.io URL-endpoint, but you can override this setting by changing the value in File types field.
Enter the semicolon-separated list to allow JS and CSS files as well, for example - *.js;*.css;*.gif;*.png;*.jpg;*.jpeg;*.bmp;*.ico;*.webp
By default ImageKit.io WordPress plugin loads files from theme folder. But you can override this setting by adding new paths in Custom files field. All the values in this field are separated by a new line. Wildcard (*) is allowed.
There could be a case where you don't want the files on a specific path or pattern to be loaded via ImageKit.io. This can be done by setting the right values in Rejected files field. All the values in this field are separated by a new line. Wildcard (*) is allowed.
For example, we want to avoid loading captcha assets through ImageKit.io, so we can enter wp-content/uploads/wpcf7_captcha/*
under rejected files, as shown in the screenshot above.