> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lighthouse

> MainWP Lighthouse Add-on is used for measuring the quality of your websites. It uses the Google PageSpeed Insights API to audit the performance, accessibility, best practices, and search engine optimization of your WordPress sites.

## What You'll Learn

* Installing and configuring the Lighthouse add-on
* Running performance audits on child sites
* Getting your Google PageSpeed Insights API key
* Understanding Lighthouse scores and reports
* Reading stored scores through MainWP Abilities

***

> [!NOTE]
>
> **Integration Add-on** - This add-on connects MainWP Dashboard to the Google PageSpeed Insights API. No third-party WordPress plugin is required.

[MainWP Lighthouse add-on - Video Tutorial](https://www.youtube.com/embed/GNYKJsoJso8)

## Install and Set Up MainWP Lighthouse Add-on

**1. Go to your MainWP Dashboard**

**2. Go to Add-ons > Manage Add-ons**

**3. Click the Install Add-ons button**

**4. Locate the Lighthouse add-on and select it**

**5. Click the Install button**

**6. Once the installation process is complete, click the Activate Add-ons button**

![Screenshot of Lighthouse add-on installation confirmation page](https://mintcdn.com/mainwp/2rlXQ4CNzTqDCqtT/images/add-ons/445c4bb68bdc.png?fit=max\&auto=format\&n=2rlXQ4CNzTqDCqtT\&q=85\&s=b2be260b38ea8f53e128e4616fa5705d)

* After successful installation, go to **Add-ons > Monitoring > Lighthouse > Settings**.

* Insert your **Google PageSpeed Insights API key**. If you don't have it, [see here how to get it](#get-the-google-pagespeed-insights-api-key).

  ![Screenshot of Lighthouse settings page with Google PageSpeed Insights API key field](https://mintcdn.com/mainwp/fYo8wl5GET5OrNvZ/images/add-ons/876c22954fd1.png?fit=max\&auto=format\&n=fYo8wl5GET5OrNvZ\&q=85\&s=f36e8934033a54065f646cd76cbe10d3)

* **Save Settings**, and you are ready to audit your sites.

## Audit Child Sites

![Screenshot of Lighthouse Dashboard page with Audit All Sites button](https://mintcdn.com/mainwp/2rlXQ4CNzTqDCqtT/images/add-ons/46448916b42b.png?fit=max\&auto=format\&n=2rlXQ4CNzTqDCqtT\&q=85\&s=a8fa671fda0bf75b72bbcff2f6e267e1)

**1. Go to Add-ons > Monitoring > Lighthouse > Dashboard**

**2. Locate the Audit All Sites button**

**3. Click it, and wait until the add-on completes the process.**

Alternatively, you can use the **Bulk Actions** menu to audit only certain sites, or use the **Audit Site** action from the site **Action Menu** to audit one site.

The Dashboard table lists every child site you have access to, including sites that don't have Lighthouse results yet. This helps you spot sites that still need their first audit.

The table loads one page of sites at a time, so it stays responsive on large networks. You can:

* Search sites by site name or URL.
* Sort by site name, last audit date, or any score column.
* Page through results and change how many sites appear per page.

## Schedule Automated Audits

**1. Go to Add-ons > Monitoring > Lighthouse > Settings**

**2. Locate the Automatically audit sites option and Enable it.**

Locate the **Automatically audit sites** option and Enable it.![Screenshot showing Automatically audit sites toggle option](https://mintcdn.com/mainwp/prJFyo89l1sl-7Fz/images/add-ons/lighthouse-seo-score.jpg?fit=max\&auto=format\&n=prJFyo89l1sl-7Fz\&q=85\&s=f44645118887184e465e98b2a6ec4454)

**3. Locate the Automated audit frequency option and set how often you want to check your sites.**

Locate the **Automated audit frequency** option and set how often you want to check your sites.![Screenshot showing Automated audit frequency dropdown options](https://mintcdn.com/mainwp/prJFyo89l1sl-7Fz/images/add-ons/lighthouse-performance-score.jpg?fit=max\&auto=format\&n=prJFyo89l1sl-7Fz\&q=85\&s=2c02b95329ce2e73729526bc2e391761)

**4. Save Settings.**

## Get a Lighthouse Report for a Site

**1. Go to Add-ons > Monitoring > Lighthouse > Dashboard**

**2. Locate the site and click the Lighthouse Report action from the Actions Menu**

Locate the site you want to check in the list and click the **Lighthouse Report** action from the Actions Menu.

![Screenshot showing Lighthouse Report action in site Actions Menu](https://mintcdn.com/mainwp/PMb515K3nlj7x2jI/images/add-ons/65dc0ec03c90.png?fit=max\&auto=format\&n=PMb515K3nlj7x2jI\&q=85\&s=bb4a8266510fda8add1252d7dbf4b23a)

**3. Once redirected to the report page, you can review all details**

## Widgets and Manage Sites Table Information

You can enable Performance Score columns (Desktop and Mobile) for the Manage Sites table from the Page Settings menu.

![Screenshot of Page Settings menu with Performance Score columns option](https://mintcdn.com/mainwp/9Fi7dKBCIriTb92d/images/add-ons/268cb5b38c9f.png?fit=max\&auto=format\&n=9Fi7dKBCIriTb92d\&q=85\&s=bdb1a942e91120c88e0cf91823d078bd)

Widgets are available on the Operations page and on the child site's Overview page.

They can also be enabled in the Page Settings on the relevant page.

The widget on the Operations page provides scores for the best and worst performing sites:

![Animated screenshot of Lighthouse widget showing best and worst performing sites](https://mintcdn.com/mainwp/prJFyo89l1sl-7Fz/images/add-ons/lighthouse-widget-scores.gif?s=3229f846da4d402d3da4610ecc712474)

The widget on the child site's Overview page provides scores for Desktop and Mobile and how that score has changed since the preceding audit.

![Screenshot of Lighthouse widget on child site page showing Desktop and Mobile scores with change indicators](https://mintcdn.com/mainwp/prJFyo89l1sl-7Fz/images/add-ons/lighthouse-dashboard.png?fit=max\&auto=format\&n=prJFyo89l1sl-7Fz\&q=85\&s=baf908288f7605b12b0c522800e1353b)

## Lighthouse Settings

![Screenshot of Lighthouse settings page showing all configuration options](https://mintcdn.com/mainwp/prJFyo89l1sl-7Fz/images/add-ons/lighthouse-widget.png?fit=max\&auto=format\&n=prJFyo89l1sl-7Fz\&q=85\&s=d0fee4a915b821b4eaac66f44dbf00c6)

* **Google PageSpeed Insights API key** - In order to run audits, you need to enter your Google PageSpeed Insights API key, if you don't have it, [see here how to get it](#get-the-google-pagespeed-insights-api-key).
* **Language** - Select language for Lighthouse reports.
* **Strategy** - Select if you want to get Desktop, Mobile, or Both strategy Lighthouse reports.
* **Notifications threshold** - Set the threshold for notifications. If any tracked Lighthouse score is at or below the set value, the add-on can send a Lighthouse notification.
* **Automatically audit sites** - If you want the add-on to automatically run audits, enable this feature.
* **Automated audit frequency** - If automated audits are enabled, here you can set how often you want them to run.
* **Maximum execution time** - Change the Max execution time if needed. If the Lighthouse reports are not being completed, increasing this value may help.
* **Maximum script run time** - Change the Max script run time if needed. If your scans do not finish completely and changing the Maximum Execution Time does not help, increase this value until you find the maximum allowed runtime.
* **Throttling delay time** - Change the Throttling delay time. Increasing this value may slow down Lighthouse reporting, but may help provide more accurate reports on poorly performing web servers.

## Audit Sites via WP-CLI

Scan one or multiple sites:

```text theme={null}
wp mainwp-lighthouse audit 125,126
```

Audit all sites:

```text theme={null}
wp mainwp-lighthouse audit --all
```

View reports for one or multiple sites:

```text theme={null}
wp mainwp-lighthouse results 125,126
```

View reports for all sites:

```text theme={null}
wp mainwp-lighthouse results --all
```

## Lighthouse REST API

All MainWP REST API calls, including full documentation, and examples, are now publicly available on [Postman](https://www.postman.com/mainwp/workspace/mainwp/overview).

For legacy REST API v1 requests, use `POST` for `/wp-json/mainwp/v1/lighthouse/audit`. The endpoint no longer accepts `GET` requests.

Please refer to our [REST API documentation](https://docs.mainwp.com/api-reference/rest-api/overview.md) for more details on enabling REST API and managing API keys.

## MainWP Abilities

The Lighthouse Add-on registers two read-only abilities in the `mainwp-lighthouse` category:

* `mainwp/get-lighthouse-overview-v1` returns API key presence, schedule settings, the number of tracked sites, and the latest desktop and mobile audit times.
* `mainwp/list-lighthouse-site-results-v1` returns paginated desktop and mobile scores, audit times, and schedule and exclusion flags for each accessible site. You can filter by site.

Use them to read stored Lighthouse data from scripts, reports, or AI tools. Both require `manage_options`, access to the Lighthouse Add-on, and Dashboard access to each site. They do not run audits, change settings, or return the API key. See the [Lighthouse Abilities reference](https://docs.mainwp.com/api-reference/abilities-api/lighthouse.md) for request examples and response fields.

```bash theme={null}
curl -u 'USERNAME:APPLICATION_PASSWORD' \
  'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-lighthouse-overview-v1/run'
```

## Get the Google PageSpeed Insights API Key

**1. Log into your Google account.**

**2. Navigate to [https://developers.google.com/speed/docs/insights/v5/get-started](https://developers.google.com/speed/docs/insights/v5/get-started) and click Get a Key button**

Navigate to [https://developers.google.com/speed/docs/insights/v5/get-started](https://developers.google.com/speed/docs/insights/v5/get-started) and click **Get a Key** button\\

![Screenshot of Google PageSpeed documentation page with Get a Key button](https://mintcdn.com/mainwp/PMb515K3nlj7x2jI/images/add-ons/62ce1ad35182.png?fit=max\&auto=format\&n=PMb515K3nlj7x2jI\&q=85\&s=0d4526d1ee42686468209f0549f4fc23)

**3. Select existing or Create a new project and click Next**

**Select** existing or **Create** a new project and click **Next**\\

![Screenshot of project selection dialog for API key creation](https://mintcdn.com/mainwp/PMb515K3nlj7x2jI/images/add-ons/69254f6a7899.png?fit=max\&auto=format\&n=PMb515K3nlj7x2jI\&q=85\&s=569f975b5b4914a8abe597c02e513a69)

**4. Copy API Key to clipboard and click Done**

**Copy API Key** to clipboard and click **Done**\\

![Screenshot showing generated API key ready to copy](https://mintcdn.com/mainwp/prJFyo89l1sl-7Fz/images/add-ons/lighthouse-settings.png?fit=max\&auto=format\&n=prJFyo89l1sl-7Fz\&q=85\&s=c8536f1f1731106a3d5b6d09bf336f13)

**5. Paste the Key to the add-on Settings.**

***

## Related Resources

* [Monitoring Add-ons](https://docs.mainwp.com/add-ons/monitoring.md) - Browse all monitoring tools
* [Lighthouse Abilities](https://docs.mainwp.com/api-reference/abilities-api/lighthouse.md) - Read the overview and stored site scores
* [Cache Control](https://docs.mainwp.com/add-ons/performance/cache-control-extension.md) - Performance optimization
* [WP Rocket Integration](https://docs.mainwp.com/add-ons/performance/rocket-extension.md) - Advanced caching tools


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.