Enabling loopback connections in WordPress means making sure your server can make HTTP requests to itself (e.g., calling https://yoursite.com/wp-cron.php
from within itself).
Loopback is required for:
-
WP-Cron jobs
-
Plugin/theme editors (to verify file write permissions)
-
Some site health checks (
Tools > Site Health
) -
Automatic updates
✅ What Is a Loopback Request?
A loopback is when your WordPress site tries to request a URL from itself using tools like wp_remote_get()
or fsockopen()
. For example:
If this fails, you might see warnings in Tools > Site Health like:
“Your site could not complete a loopback request.”
🛠How to Enable Loopback Requests
Here are the key steps depending on your hosting/server setup:
✅ 1. Make Sure localhost
or Domain Resolves Internally
Check your server can resolve requests to itself.
Use this quick PHP script:
Create a file test-loopback.php
in your WordPress root:
Then visit https://yoursite.com/test-loopback.php
✅ 2. Check Firewall or Security Plugins
-
Plugins like Wordfence, iThemes Security, or Cloudflare may block loopback connections.
-
Temporarily disable them and test again.
✅ 3. Check wp-config.php
for Restrictions
Make sure these aren’t defined:
If they are, they might block loopback connections. Remove or adjust them carefully.
✅ 4. Hosting-Specific Fixes
Depending on your host:
Hosting | Fix |
---|---|
cPanel/VPS | Ensure localhost or domain resolves via hosts file (127.0.0.1 yourdomain.com ) |
NGINX | Check server_name includes your domain |
Apache | Make sure mod_rewrite and mod_headers are enabled |
Cloud Hosting | Ensure the firewall allows outbound connections to itself (port 80/443) |
✅ 5. Fix with hosts
File (advanced)
If your server can't resolve its own domain, you can force it to resolve internally via the hosts
file:
Linux/macOS:
Add:
⚠️ Only do this if you control the server and know it won’t affect DNS resolution in a shared environment.
✅ 6. Check with wp-cli
(optional)
If you use WP-CLI:
If it fails, it usually gives more details about loopback errors.
✅ 7. cURL/Fsockopen Must Be Enabled
Your server must support cURL or fsockopen, which are used by wp_remote_get()
. Most servers already do, but double check with:
Look for cURL support => enabled
.
✅ Final Note
Once fixed, go to:
WP Admin > Tools > Site Health > Status
And the warning about loopback should be gone.
Ref: Important: HTTP Loopback Connections are not enabled on this server. If you need to contact your web host, tell them that when PHP tries to connect back to the site at the URLThis can be easily fixed using server configuration settings going to VPS Setiing and one click theme Demo import will work for wordpress site.
You need to vavigate VPS Server panel for server configuration setting and alter the line as shown.Only change servername parameter adding localhost localhost..localdomain
then listen 127.0.0.1:443 ssl
Comments
Post a Comment