PHPackages                             picperf/wordpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. picperf/wordpress

ActiveWordpress-plugin[Image &amp; Media](/categories/media)

picperf/wordpress
=================

Drop-in image optimization for the modern web.

0.5.0(2y ago)24[1 issues](https://github.com/alexmacarthur/picperf-wordpress/issues)GPL-2.0-onlyPHP

Since Oct 17Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/alexmacarthur/picperf-wordpress)[ Packagist](https://packagist.org/packages/picperf/wordpress)[ RSS](/packages/picperf-wordpress/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

PicPerf WordPress Plugin
========================

[](#picperf-wordpress-plugin)

[PicPerf](http://picperf.io) is a service for automatically optimizing, reformating, and aggressively caching your website's images just by prefixing the URLs you're already using. This WordPress plugin will take care of that part too, making it even easier to upgrade your image performance.

Getting Started
---------------

[](#getting-started)

1. Create an account.

In order to benefit from this plugin, you'll need to first sign up for a plan at [picperf.io](https://picperf.io). You'll automatically be given a 14-day free trial (no card required), but in order keep your images optimized beyond that, upgrade to a regular plan.

1. Add your domain.

Add your website's domain inside the PicPerf dashboard. If your WordPress site runs on a different domain from your public website, please add both domains.

Installation
------------

[](#installation)

After you've created an account and added your domain, all you need to do is install the plugin and activate it. You're set!

Usage
-----

[](#usage)

This plugin will automatically prefix every URL found in images, style tags, inline styles, and data attributes with `https://picperf.io`, allowing it to be optimized, reformatted, and globally cached. By default, it'll impact every image that's rendered in the final HTML output of your page.

### Changing Transformation Scope

[](#changing-transformation-scope)

If you'd like to disable universal URL transformations, you can set the `PICPERF_TRANSFORMATION_SCOPE` constant in your `wp-config.php` file to `null`. Setting it to `CONTENT` will cause only images rendered via the `the_content` filter to be transformed. For example:

```
// Transform all images (default).
define('PICPERF_TRANSFORMATION_SCOPE', 'ALL');

// Only transform `the_content` images.
define('PICPERF_TRANSFORMATION_SCOPE', 'CONTENT');

// Transform no images.
define('PICPERF_TRANSFORMATION_SCOPE', null);
```

### Using an Auto-Generated Image Sitemap

[](#using-an-auto-generated-image-sitemap)

When a `sitemap_path` query parameter is set on an image, PicPerf will automatically include it in an image sitemap generated for you. By default, no images are included in the sitemap. However, you can enable this by setting the `PICPERF_ADD_SITEMAP_PATH` constant.

You

```
