We have a wordpress database with property details. When doing a url call in a browser using the postid it works fine and the screendump shows all fields and info. Going into a http request node (get) using a generic credential type, basic auth and then my wp rest api credentials it still comes back with credentials not found. Tried everthing, whitelisted the ip’s from n8n in cloudflare, made changes in .htaccess No luck so far…Anyone an idea what it could be ?
Even though you can see your data in a web browser, n8n is struggling because it uses a different way to “introduce” itself to your website. While your browser uses saved login sessions and cookies, n8n sends a specific security instruction called an “Authorization header.” If your website server isn’t configured to recognize and pass this specific header along to the WordPress software, it will act like n8n hasn’t provided any credentials at all, even if you typed them in correctly.
One major reason this happens is using the wrong type of password. You should not use your regular WordPress login password for n8n. Instead, you need to go into your WordPress user profile settings and generate a special “Application Password.” This is a unique, 24-character code designed specifically for automation tools to talk to your site securely without needing your main account password.
Even with the right password, your web server might be “stripping” the security information away before it actually reaches WordPress. This is a very common issue if your website uses certain hosting setups (like those using Nginx) to manage traffic. Essentially, the server sees the security code, thinks it isn’t needed for a standard webpage, and throws it away before WordPress can read it, which results in the “credentials not found” error.
To fix this easily without needing to be a server expert, you can add a small piece of code to a file called wp-config.php on your website. This code acts like a safety net, catching the security header if it gets misplaced and making sure it reaches WordPress safely. Once you add this snippet and ensure you are using a special Application Password, n8n should be able to connect to your database without any issues.
if (!isset($_SERVER['HTTP_AUTHORIZATION']) && isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
$_SERVER['HTTP_AUTHORIZATION'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
}
Note: Add this code at the very top, immediately after the opening <?php tag of wp-config.php