Recently we migrated our site from Drupal to Wordpress, everything seems to be working fine however we can't edit mosaico templates we had created while we were on Drupal. Have bunch of JS errors on browser console, seems its trying to load template from oldsite.

Checked the Resource URL, Directories settings everything seems to be correct. Also cleared CiviCRM cache and delete template_c with no success.

Any pointers would be appricated

Thank you


Mosaico extension stores path in civicrm_mosaico_template and civicrm_mosaico_msg_template table. When mosaico extension code is moved you will need to update path in these tables to new path.

You can run below query to update the path from sites/default/files/civicrm/ext/ to wp-content/civicrm_extensions/

UPDATE civicrm_mosaico_template 
SET metadata = REPLACE(metadata, 'sites/default/files/civicrm/ext/', 'wp-content/civicrm_extensions/‘);

UPDATE civicrm_mosaico_msg_template 
SET metadata = REPLACE(metadata, 'sites/default/files/civicrm/ext/', 'wp-content/civicrm_extensions/‘);



  • Thank you, that worked i needed to update civicrm_mosaico_template table. Mar 31 at 20:13

If you want to also edit any draft emails that use Mosaico, you also need to run this query:

UPDATE civicrm_mailing SET template_options = REPLACE(template_options, 'https:\\/\\/proddomain.ext\\/media\\/civicrm\\/ext\\', 'https:\\/\\/devdomain.ext\\/media\\/civicrm\\/ext\\') WHERE template_type = 'mosaico';

In my example, note that I have a absolute path in my templates (not sure if this is always the case).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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