• English日本語한국어
  • Log inStart now

WordPress Full Stack 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.

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


Install the infrastructure agent

You can install the infrastructure agent two different ways:

Install the PHP agent

  1. Check out our PHP agent requirements before installing the agent.
  2. Open the PHP quickstart installation.
  3. Click Install now to start the PHP agent installation.

Install the MySQL quickstart

  1. Check out our MySQL requirements.
  2. Open MySQL quickstart installation.
  3. Click Install now to start the MySQL agent installation.

Install the Apache quickstart

  1. Check out our Apache requirements.
  2. Open the Apache quickstart installation.
  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:

  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:

    - name: nri-flex
    interval: 180s
    name: linuxDirectorySize
    - event_type: INSERT_EVENT_TYPE
    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:

    // 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 to forward WordPress logs to New Relic.

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


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

- name: wordpress-debug.log
file: /src/www/wordpress/wp-content/debug.log
logtype: wordpress_debug

Restart the infrastructure agent

Before you can start reading your data, use the instructions in our infrastructure agent docs to restart your infrastructure agent.

sudo systemctl restart newrelic-infra.service

In a couple of minutes, your application will send metrics to one.newrelic.com.

Find your 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, go to the + Add data 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.

Here's an example NRQL query to check the delay for first input:

SELECT percentage(count(*),
WHERE firstInputDelay < 100)
AS 'Good (<100ms)', percentage(count(*),
WHERE firstInputDelay >= 100 and firstInputDelay < 300)
AS 'Needs improvement (>=100 <300ms)', percentage(count(*),
WHERE firstInputDelay >= 300)
AS 'Poor (> 300ms)'
FROM PageViewTiming
WHERE firstInputDelay IS NOT NULL

What's next?

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

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.