Wysiwyg image is showing up in media/wysiwy not inside pub/media/wysiwyg. How do I fix this?

Wysiwyg image is showing up in media/wysiwy not inside pub/media/wysiwyg. How do I fix this?

July 27, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Wysiwyg image is showing up in media/wysiwy not inside pub/media/wysiwyg. How do I fix this?

Resolving Wysiwyg Image Loading Issues in Magento 2

As a senior developer working with Magento 2 projects, I often encounter issues related to image paths within the Wysiwyg text editor. The most common problem is finding images stored in pub/media/wysiwyg instead of the expected media/wysiwyg. Let’s dive into this issue and explore how to fix it in your live site.

Understanding the Issue

In a standard Magento 2 setup, especially when using Nginx with the document root set to pub, the media directory is located at pub/media. However, for images used within Wysiwyg content, Magento expects them to be stored in the subdirectory media/wysiwyg due to its configuration. When you upload an image through the Wysiwyg editor in the admin panel, it correctly stores the file in pub/media/wysiwyg, but when this content is rendered on the live site, Magento fails to locate the image because it’s trying to access a non-existent pub/media/wysiwyg directory.

Diagnosing the Problem

To understand why your images aren’t loading, let’s examine how Magento generates the image path:

  1. When you save an image through the Wysiwyg editor, it gets stored in the actual file system at pub/media/wysiwyg.
  2. In your database, the corresponding value field for the Wysiwyg content stores a relative path like /media/wysiwyg/image.jpg.
  3. During rendering on the live site, Magento tries to retrieve the image using this relative path.
  4. However, with Nginx configured to serve files from the pub directory, Magento can’t find the image because it’s looking in an empty subdirectory.

Solving the Issue

To resolve this problem without modifying project-wide configurations, you can create a symbolic link (also known as a soft link) between pub/media/wysiwyg and media/wysiwyg. This trick fools Magento into thinking that both directories are the same while keeping your file structure intact.

Here’s how to do it:

  1. Open your terminal or command prompt.
  2. Navigate to the root directory of your Magento project (usually htdocs).
  3. Run the following command to create a symbolic link:
    ln -s pub/media/wysiwyg media/wysiwyg
    

This command creates a symbolic link called media/wysiwyg that points to the real directory at pub/media/wysiwyg.

Verifying the Solution

After creating the symbolic link:

  1. Save a new Wysiwyg image in your admin panel.
  2. Refresh any page containing Wysiwyg content on your live site.
  3. Check if the images are now loading correctly.

If everything is set up properly, Magento should be able to locate and display the Wysiwyg images without any issues.

Conclusion

Fixing Wysiwyg image loading problems in Magento 2 requires a basic understanding of file system operations and symbolic links. By creating a symbolic link between pub/media/wysiwyg and media/wysiwyg, you can ensure that your images are correctly loaded on the live site without needing to modify project-wide configurations.

Remember, always backup your data before making changes in the file system, especially when dealing with symbolic links. If you’re unsure about any aspect of this process, consider reaching out to a professional Magento developer or consulting the official documentation for further guidance.

For more advanced solutions and best practices in Magento 2 development, be sure to check out our comprehensive guides at Laravel Company.

Magento 2 Database Admin Configuration

Our network