How to Fix WordPress Images Loading From Server IP Instead of Domain (AWS + Bitnami + Elementor)

This issue commonly occurs on AWS Bitnami WordPress installs when the site is initially accessed via the server IP address instead of the domain. Even after updating the site URL, images may continue loading from the IP.

The Problem

Images load from an IP like http://44.196.11.84/wp-content/uploads/2026/01/example.webp, instead of https://dev.manzari.com/wp-content/uploads/2026/01/example.webp.

Why This Happens

WordPress was accessed or installed using the server IP, media was uploaded before the domain was fully configured, and Elementor generated static CSS/HTML files containing the IP. Updating home and siteurl alone does not retroactively fix existing media URLs or cached files.

Step 1: SSH Into the Server

ssh -i "C:\path\to\your-key.pem" bitnami@YOUR_SERVER_IP

Step 2: Navigate to the WordPress Root

cd /opt/bitnami/wordpress

Confirm you’re in the correct directory by verifying that wp-config.php and wp-content are present.

Step 3: Confirm Site URL Is Correct

In WordPress Admin or phpMyAdmin, confirm that home and siteurl are both set to https://dev.manzari.com. This ensures future URLs are correct but does not fix existing media or cached output.

Step 4: Run a Safe WP-CLI Dry Run

Before making changes, preview what would be updated:

sudo wp search-replace 'http://YOUR_SERVER_IP' 'https://dev.manzari.com' --all-tables --precise --dry-run

If you see output like Success: 48 replacements to be made, WP-CLI has found references but has not modified anything yet.

Step 5: Apply the Search & Replace

Run the same command without --dry-run to apply the changes:

sudo wp search-replace 'http://YOUR_SERVER_IP' 'https://dev.manzari.com' --all-tables --precise

You should see Success: Made xx replacements. At this point, the database is clean.

Step 6: Flush WordPress Cache

sudo wp cache flush

Step 7: Remove Elementor Generated CSS (Critical)

Elementor stores static files that may still reference the IP. Delete them:

sudo rm -rf wp-content/uploads/elementor/css/*

Step 8: Regenerate Elementor Files

In WordPress Admin, go to Elementor → Tools and click Regenerate Files & Data, then wait for the process to complete.

Step 9: Hard Refresh the Browser

Use Ctrl + Shift + R or open a private/incognito window to avoid cached assets.

Step 10: Verify the Fix

Open DevTools → Network tab, reload the page, and inspect an image request. It should now load from https://dev.manzari.com/wp-content/uploads/... and not the server IP.

Leave a Reply

Your email address will not be published. Required fields are marked *