PortGate

Blueprints · WordPress

Beginner 10 min · Nginx

WordPress xmlrpc off

Stages an Nginx deny for xmlrpc.php. WordPress itself can also filter the method.

Live config

Baked-in protections

Step 1 · conf

Nginx location

/root/portgate-blueprints/deny-xmlrpc.conf

Put this in the WordPress server block.

location = /xmlrpc.php {
    deny all;
}

Step 2 · bash

Read-only check

/root/portgate-blueprints/xmlrpc-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
if [ -f "/var/www/html/xmlrpc.php" ]; then
  echo "xmlrpc.php is on disk. The deny snippet is staged."
else
  echo "xmlrpc.php was not found at /var/www/html."
fi