# How to run a PageSpeed audit

> Run Google PageSpeed Insights against any URL without leaving WordPress, for mobile or desktop — with the API key you will need for audits to actually complete.

- Category: Health & insights
- Canonical: https://xspeedcache.com/docs/pagespeed/

---

Google's PageSpeed Insights is the score people quote and the one clients ask about. This tab runs it against any URL on your site from inside WordPress, keeps the history, and lets you compare mobile against desktop — without switching to another tab and pasting URLs.

> **Where to find it**
>
> 1. In your WordPress admin, click **xSpeed Cache** in the left menu.
> 2. In the xSpeed Cache sidebar, open the **Health & insights** group.
> 3. Click the **Health** card, then the **PageSpeed** tab.
>
> *Shortcut: open `wp-admin/admin.php?page=xspeed#/insights/health/pagespeed` directly.*
>
> ⭐ This tab is part of **xSpeed Pro**.

![The audit controls](https://xspeedcache.com/_astro/pagespeed-audit.B8GAZzuq.png)

1. **URL to audit** and **Strategy** — with **Run audit**.
2. **PageSpeed API key** — labelled optional, but needed in practice.

---

## Settings at a glance

| Setting | Default | What it does |
| --- | --- | --- |
| **URL to audit** | Your site URL | Which page to test. |
| **Strategy** | Mobile | Test as a mobile or desktop device. |
| **PageSpeed API key** | Empty | Labelled optional — but required in practice. See below. |

---

## How it works

Enter a URL, pick a strategy, press **Run audit**. xSpeed calls Google's PageSpeed Insights API and stores the result, so you build a history rather than a one-off number.

**Mobile is the default, and that's the right default.** Google uses mobile performance for ranking, and mobile scores are typically lower because the test simulates a slower device and network. A good desktop score with a poor mobile one is the common pattern, and mobile is the one that counts.

Test the pages that matter — your homepage, a representative post, your highest-value landing page — rather than auditing everything.

---

## The API key — labelled optional, needed in practice

The field says **(optional)** and the panel says *"Higher quota when set; PSI works without one too."* Both are technically true: Google's API does accept anonymous requests.

**In practice you need a key.** The anonymous daily quota is small and shared, and it is routinely exhausted — audits then fail with an error instead of returning a score:

```
Quota exceeded for quota metric 'Queries' and limit 'Queries per day'
```

That isn't a hypothetical. On a fresh install with no key, the first audits typically fail exactly this way, and only start succeeding once a key is configured. Treat the key as a setup step rather than an optimisation you might get to later.

### Getting one

It's free. Create a project at **cloud.google.com**, enable the **PageSpeed Insights API**, and generate an API key. The panel links to Google's documentation from the field.

Once saved, the key raises your limit to a per-project quota that a normal site will never approach.

> ⚠️ **Without a key, a failed audit looks like a broken feature.** You press **Run audit**, nothing appears, and there's no obvious reason why. The failure is recorded with its error text, so check the run history on the [Speed test](https://xspeedcache.com/docs/external-score/) tab — a quota message there means you need a key, not that anything is wrong with your site.

---

## Reading the result

PageSpeed is a **lab test** — one machine, one simulated connection, one moment. That makes it reproducible and good for comparing before and after a change, but it isn't a measurement of what your visitors experienced.

For that, [Visitors](https://xspeedcache.com/docs/visitors/) records real page loads from real devices. Use the two together:

| Question | Tab |
| --- | --- |
| "What would Google score this page?" | **PageSpeed** |
| "How fast is my site for actual visitors?" | [Visitors](https://xspeedcache.com/docs/visitors/) |
| "Is caching working at all?" | [Overview](https://xspeedcache.com/docs/cache-diagnostics/) |

The specific opportunities PSI lists — render-blocking resources, unused CSS, oversized images — map directly onto panels in this plugin: [Minify](https://xspeedcache.com/docs/minify/), [Unused CSS](https://xspeedcache.com/docs/unused-css/), [Image Optimization](https://xspeedcache.com/docs/image-optimization/).

---

## Related

- [How to check your site health](https://xspeedcache.com/docs/health/)
- [How to measure real visitor speed](https://xspeedcache.com/docs/visitors/)
- [How to read your cache diagnostics](https://xspeedcache.com/docs/cache-diagnostics/)
- [How to run a speed test](https://xspeedcache.com/docs/external-score/)
- [How to activate your licence](https://xspeedcache.com/docs/license/)
