Inserted images not showing in Drupal: Troubleshooting steps
If the images you have inserted are not showing up in Drupal, there could be several reasons for this issue. Here are some troubleshooting steps you can follow:
Check the text format
If you insert an inline image, ensure that the text format option under the "Body" field has not been set to "Restricted HTML" or some other text format that will filter out HTML tags outside a preset whitelist.
Check error logs
Go to Reports → Recent log messages. Look for any error messages or warnings related to image loading in the Drupal logs or the server's error logs. They may provide more insights into the underlying issue.
You can also check your Nginx/Apache error.log
and access.log
on the server.
Check image field settings
If you are using an image field or a custom image field in Drupal, verify the field settings. Ensure that the field is configured to accept the correct file extensions and file sizes. Make sure that the image field is enabled for the content type or entity where you are trying to display the images.
Check the image file path on the resulting page
View the resulting page where the image should appear and inspect the HTML source code. Look for the image tag corresponding to the image you are troubleshooting. Compare the file path in the admin panel with the file path in the resulting page. Verify that the src
attribute of the image tag matches the file path you observed in the admin panel or is relative to the correct location.
Check Drupal's file system settings
In the Drupal admin panel, go to Configuration → Media → File system and verify the "Public file system path" setting. This setting determines the location where uploaded files, including images, are stored. Ensure that the path specified here is correct and accessible.
Verify file permissions
Ensure that the image file and its parent directories have appropriate permissions set so that they can be accessed by the web server.
Clear Drupal caches
Clear the Drupal caches by navigating to Configuration → Performance and clicking on the "Clear all caches" button. This can help ensure that any cached data related to file paths is refreshed.