Images do not show when I’m logged out
On this page
Question
When I log out of WordPress, images have disappeared but when I log back in, those images appear. Why is that and how can I fix this?
Solution
Since you’re using Staq Cache, our solution rewrites the HTML and replaces your images with either:
- CDN based URLs;
- WebP formatted URLs.
To rectify this, please follow the steps below.
Diagnosing images via Inspect Console
- Navigate to the Page with the Broken Image: Open the webpage where the image appears broken.
- Open the Inspect Console: Right-click on the broken image and select ‘Inspect’ or ‘Inspect Element’. This will open the browser’s developer tools, specifically the ‘Elements’ tab.
- Locate the Image Source: In the ‘Elements’ tab, look for the
imgtag related to the broken image. It will have an attribute namedsrcwhich indicates the source URL of the image. - View the Console Tab: Navigate to the ‘Console’ tab in the developer tools. This is where any errors related to the page will be displayed.
- Identify the Error: Look for errors related to the image. These will usually be colored red and may contain the source URL of the broken image. Note down the error message.
Understanding Server Errors
- 404 Not Found: This means that the server couldn’t find the requested image. It’s possible the image has been deleted or the URL is incorrect.
- 403 Forbidden: The server understood the request, but it’s refusing to fulfill it. This could be due to permissions or security settings.
- 500 Internal Server Error: A generic error message indicating that the server encountered an unexpected condition that prevented it from fulfilling the request.
- 504 Gateway Timeout: The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server or some other auxiliary server it needed to access to complete the request.
Note: These are some common server errors related to images, but there can be other errors as well. It’s essential to understand the specific error to take appropriate action.
Need some help?
We all do sometimes. Please reach out to our support team by dropping us a support ticket. We will respond fast.