How to insert image in magento cms editor

How to insert image in magento cms editor

July 3, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to insert image in magento cms editor

Inserting Images into Magento CMS Editor: A Step-by-Step Guide

Hello developers! Today, let’s tackle a common issue that many of us face when working with the Magento Content Management System (CMS). I’m Murali, and I’ll walk you through the steps to insert images using the editor in your Magento admin panel.

The Problem: Images Not Appearing After Upload

You’ve successfully uploaded an image from your computer. You click on “Insert Image” after the upload is complete. But here’s where the frustration begins - the path isn’t appearing in the “src url” field of the popup dialog box! This leaves you scratching your head, wondering why the image won’t show up in your editor.

The Solution: Understanding Magento’s Media Configuration

Before we dive into the solution, let me briefly explain how Magento manages media files. By default, Magento stores uploaded images and other media files in the media folder located at the root level of your Magento installation (usually /var/www/html/magento/media). However, this path may not always be accessible or visible when you’re working with the CMS editor.

Step 1: Check Your Media Permissions

First things first - let’s ensure that the media files have the correct permissions to be accessed by the web server. Here are the steps:

  1. Navigate to your Magento installation directory in a terminal.
  2. Run this command to set the appropriate permissions for the media folder and its subdirectories:
chmod -R 755 media
  1. If you’re running on an Apache server, make sure the web user (usually apache, www-data, or your specific system user) has write access to the media directory.

Step 2: Configure Magento’s Media URLs

Now let’s configure Magento to properly handle and display media files in the CMS editor. Follow these steps:

  1. Log in to your Magento admin panel.
  2. Navigate to Stores > Configuration.
  3. Select Content Management under the Content heading on the left sidebar menu.
  4. Locate the “Base Media URL” field under the “Media” section.

By default, this field might be empty or set to something like http://example.com/media/. However, if you’ve installed Magento using a different document root or subdomain, you should update this path accordingly.

For example, if your Magento installation is hosted in a subdirectory called /magento, the “Base Media URL” should be updated to https://yourdomain.com/magento/media.

  1. Save the configuration.

Step 3: Inserting Your Image

Now let’s try uploading and inserting an image again:

  1. Navigate to Content > Pages in your admin panel.
  2. Select or create a page where you want to insert your image.
  3. Click on “Edit” next to the content field for that specific page.
  4. Place your cursor at the location where you’d like your image to appear.

Step 4: The Proper Way to Insert an Image

When inserting images, always use the “Insert Image from File Manager” option provided by Magento’s WYSIWYG editor:

  1. Click on the “Image” icon in your editor menu (it looks like a small mountain).
  2. Select “Insert Image from File Manager.”
  3. Navigate to the folder containing your uploaded image.
  4. Choose your desired image.
  5. Click “Insert.”

Step 5: Verify Your Image

After following these steps, you should see that the image appears correctly in your editor’s content field with the appropriate path set in the src url.

Conclusion: Mastering Magento Media Management

Remember that working with media files in Magento requires a balance between file management and proper configuration. Always ensure that your media files have the correct permissions for web access, and verify that Magento is configured to properly handle and display these assets.

If you’re looking for more advanced tutorials on Magento development and optimization, feel free to check out our blog at Laravel Company. We cover a wide range of topics to help you enhance your e-commerce development skills.

Happy coding! Let me know if you have any other questions or need further clarification.

Security Admin Configuration Errors

Our network