we have created some category's custom attribute of WYSIWYG editor type. While we are adding image in these custom attribute's editor, they are showing/loading fine in admin section but while we are fetching these attributes data on frontend, images are not loading.

Magento making image url on frontend like - <img src="{{media url=&quot;handmade-thumb.jpg&quot;}}" alt="" />

Its picking image url as text.

Please help me to solve this issue.

1 Answer 1


You need to filter that content using cms page filter.

Try following way:

public function __construct(
    \Magento\Cms\Model\Template\FilterProvider $filterProvider
) {
    $this->_filterProvider = $filterProvider;

Now use:

  • Hie @Sohel Rana here $content means what? Commented Aug 13, 2020 at 7:36
  • Thanks for solution. It is working fine. Commented Mar 22, 2021 at 21:20

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.