---
title: WordPress full stack integration
source: https://docs.newrelic.com/docs/apm/agents/php-agent/frameworks-libraries/wordpress-fullstack-integration
---

Our WordPress integration monitors the performance of your WordPress web application, helping you diagnose issues in your application and optimize your code. Our WordPress integration makes use of our PHP, Apache, and MySQL integrations, and gives you a pre-built dashboard with your most important WordPress metrics like transactions, visitors, and call duration.

![A screenshot depicting the wordpress dashboard](https://docs.newrelic.com/images/infrastructure_screenshot-full_wordpress-dashboard.webp "WordPress dashboard")

After setting up our WordPress integration, we give you a dashboard for your WordPress metrics.

## Install [#install]

### Install the infrastructure agent [#infra-install]

You can install the infrastructure agent two different ways:

-   Our [guided install](https://one.newrelic.com/nr1-core?state=4f81feab-35f7-e97e-9903-52510f8542bd) is a CLI tool that inspects your system and installs the infrastructure agent alongside the application monitoring agent that best works for your system. To learn more about how our guided install works, check out our [Guided install overview](https://docs.newrelic.com/docs/infrastructure/host-integrations/installation/new-relic-guided-install-overview).
-   If you'd rather install our infrastructure agent manually, you can follow a tutorial for manual installation for [Linux](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/install-infrastructure-monitoring-agent-linux), [Windows](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/windows-installation/install-infrastructure-monitoring-agent-windows/), or [macOS](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/macos-installation/install-infrastructure-monitoring-agent-macos/).

### Install the PHP agent

1.  Check out our [PHP agent requirements](https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/monitor-your-php-app/) before installing the agent.
2.  Open the [PHP quickstart installation](https://newrelic.com/instant-observability/php).
3.  Click **Install now** to start the PHP agent installation.

### Install the MySQL quickstart

1.  Check out our [MySQL requirements](https://docs.newrelic.com/docs/infrastructure/host-integrations/host-integrations-list/mysql-config//).
2.  Open [MySQL quickstart installation](https://newrelic.com/instant-observability/mysql).
3.  Click  **Install now** to start the MySQL agent installation.

### Install the Apache quickstart

1.  Check out our [Apache requirements](https://docs.newrelic.com/docs/infrastructure/host-integrations/host-integrations-list/apache-monitoring-integration/).
2.  Open the [Apache quickstart installation](https://newrelic.com/instant-observability/apache).
3.  Click  **Install now** to start the Apache agent installation.

### Configure NRI-Flex for WordPress

Flex comes bundled with the New Relic infrastructure agent. To create a flex configuration file follow these steps:

1.  Create a file named `read-wordpress-files-config.yml` in this path:

    ```shell
    /etc/newrelic-infra/integrations.d
    ```

2.  Update the `read-wordpress-files-config.yml` with these details:

    -   `INSERT_EVENT_TYPE`. An `event_type` is a New Relic database table that you can query using NRQL. An example of `event_type` would be  `WPDirectories`
    -   `INSERT_WORDPRESS_PATH`. Here, you need to enter the directory for your WordPress application, like: `/srv/www/wordpress/*`.

3.  Use this configuration file:

    ```yml
    integrations:
      - name: nri-flex
        interval: 180s
        config:
          name: linuxDirectorySize
          apis:
            - event_type: INSERT_EVENT_TYPE
              commands:
                - run: du INSERT_WORDPRESS_PATH
                  split: horizontal
                  set_header: [dirSizeKB, dirName]
                  regex_match: true
                  split_by: (\d+)\s+(.+)
    ```

### Configure WordPress to expose debug logs

1.  Open your WordPress application and then open the `wp-config.php` file.
2.  Update the file with the values listed below:

    ```php
    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );

    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    ```

    Once you start your application, you will see a `debug.log` file in the `wp-content` directory.

### Forward WordPress debug logs to New Relic

You can use our [log forwarding](https://docs.newrelic.com/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/) to forward WordPress logs to New Relic.

On Linux machines, your log file named `logging.yml` should be present in this path:

````shell
/etc/newrelic-infra/logging.d/
```

After creating the log file, add the following script to the `logging.yml` file:

```yml
logs:
  - name: wordpress-debug.log
    file: /srv/www/wordpress/wp-content/debug.log
    attributes:
      logtype: wordpress_debug
```

````

### Restart the infrastructure agent

Before you can start reading your data, use the instructions in our [infrastructure agent docs](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/manage-your-agent/start-stop-restart-infrastructure-agent/) to restart your infrastructure agent.

````shell
sudo systemctl restart newrelic-infra.service
```

In a couple of minutes, your application will send metrics to [one.newrelic.com](https://one.newrelic.com).

````

## Find your data [#find-data]

You can choose our pre-built dashboard template named `WordPress Full Stack` to monitor your WordPress application metrics. Follow these steps to use our pre-built dashboard template:

1.  From [one.newrelic.com](https://one.newrelic.com), go to the **+ Integrations & Agents** page.
2.  Click on **Dashboards**.
3.  In the search bar, type `WordPress Full Stack`.
4.  The WordPress dashboard should appear. Click on it to install it.

Your WordPress dashboard is considered a custom dashboard and can be found in the **Dashboards** UI. For docs on using and editing dashboards, see [our dashboard docs](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards).

Here's an example NRQL query to check the delay for interaction to next paint (INP):

```sql
SELECT percentage(count(*),
WHERE interactionToNextPaint < 200)
AS 'Good (<100ms)', percentage(count(*),
WHERE interactionToNextPaint >= 200 AND interactionToNextPaint < 500)
AS 'Needs improvement (>=100 <300ms)', percentage(count(*),
WHERE interactionToNextPaint >= 500)
AS 'Poor (> 300ms)'
FROM PageViewTiming
WHERE interactionToNextPaint IS NOT NULL
TIMESERIES AUTO
```

## What's next? [#whats-next]

To learn more about querying your data and creating custom dashboards, check out these docs:

-   [Introduction to the query builder](https://docs.newrelic.com/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder)
-   [Introduction to custom dashboards](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards)
-   [Manage your dashboard](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/manage-your-dashboard)
