I've noticed a weird behavior from the WYSIWYG editor in the product description. Whenever I insert an image it will output

<img src="{{media url="http://example.com/media/wysiwyg/the-picture.jpg"}}" alt="" />

while in another context, such as static blocks editing, it would output

<img src="{{media url=wysiwyg/the-picture.jpg"}}" alt="" />

This results in displaying

<img alt="" src="http://example.com/media/http://example.com/media/wysiwyg/the-picture.jpg">

which is obviously not what I want.

I've searched on different topics, and no one seems to have that specific problem. Did anyone come across this, does anyone have a fix?

  • have same problem in any solution pls
    – Zahirabbas
    Commented Jun 5, 2015 at 6:19
  • 1
    i feel your pain here - i have the same issue. shame nobody could give you the answers you were looking for :(
    – Jimmery
    Commented Sep 10, 2015 at 9:04

4 Answers 4


the error is due to Mage::getBaseUrl('media') does not pass the store parameter !

To solve this bug, change in :


Find function : getImageHtmlDeclaration

and change :

$mediaPath = str_replace(Mage::getBaseUrl('media'), '', $fileurl);


$mediaPath = str_replace(mage::app()->getStore($this->_storeId)->getBaseUrl('media'), '', $fileurl);

If you look at the file Mage_Adminhtml_Catalog_ProductController you will see where it add the store url for product wysiwyg.

$storeMediaUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

$content = $this->getLayout()->createBlock('adminhtml/catalog_helper_form_wysiwyg_content', '', array(
    'editor_element_id' => $elementId,
    'store_id'          => $storeId,
    'store_media_url'   => $storeMediaUrl,

My suggestion for you would be to look into this and debug what exactly is being passed to the config. It might also be worth comparing how this is done in cms pages.

  • Thanks for bringing that up, I'll try and have a look at it. Tbh I moved on to something else since then, but +1 for pointing out a specific spot to look up. Commented May 23, 2014 at 12:19
  • @JulienLachal are you still getting the issue? Commented May 23, 2014 at 12:20
  • I bet my client does, but I told them how to correct that. Commented May 23, 2014 at 12:21
  • Any luck with this? I got same issue in Magento
    – Jaro
    Commented Jan 16, 2015 at 9:25
  • have same problem in any solution pls
    – Zahirabbas
    Commented Jun 5, 2015 at 6:18

Check the following configuration setting: System -> Configuration -> Catalog -> Catalog -> Frontend -> Allow Dynamic Media URLs in Products and Categories

  • I've checked and it's set to "Yes" already :/ Commented Mar 6, 2014 at 9:07

Use the following code.

<img src="{{media url="/wysiwyg/the-picture.jpg"}}" alt="" />

the media url 'll give the store media url like http://www.yourdomain.com/media

to get Store Url

{{store url=""}}

to get Skin Url

{{skin url=""}}

More Details Refer this

  • Thank you, but it does not answer my question in any way. My problem is that the url generated by the WYSIWYG editor is wrong, and I'd like it to give me the right URL all the time without having to modify it by hand. Commented Mar 6, 2014 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.