# Alter WYSIWYG settings in Drupal — Liran Tal

Altering WYSIWYG settings to make image URLs absolute so that they are also accessible via Email clients.

Canonical: https://lirantal.com/blog/2012-10-09

![Cover artwork for Alter WYSIWYG settings in Drupal](/_astro/photo-1468956398224-6d6f66e22c35.BePqp3CW_Zj88Tk.jpg)

If you deliver content notifications over email and that content may have images attached to it, inline in the message, it will badly display an image source that it can’t find. This is because when the WYSIWYG adds the image to the page it sets the image source to be a relative URL such as `/system/files/image_1.jpg`.

It’s possible to create an alter hook that changes the init settings passed to the WYSIWYG and making every attached image as a full `http://` source link.

```
/**
 * Implements hook_wysiwyg_editor_settings_alter
 * Alters the WYSIWYG editor settings to make URLs for images be absolute (i.e: prefixed with http://)
 * so that they are also accessible via Email clients.
 */
function my_module_wysiwyg_editor_settings_alter($settings, $context) {
 $settings['convert_urls'] = TRUE;
 $settings['relative_urls'] = FALSE;
 $settings['remove_script_host'] = FALSE;
}
```

## More writing

[All writing](/blog)

*   Sep 5, 2026

    ### [Self-Hosting Hermes Agent with Matrix E2EE on Proxmox](/blog/self-host-hermes-agent-matrix-e2ee-proxmox)

*   Aug 2, 2026

    ### [The Practical Second Brain: Building an LLM-Operated Markdown Knowledge Graph](/blog/practical-second-brain-llm-markdown-knowledge-graph)

*   Aug 1, 2026

    ### [Building a Second Brain with LLMs and AI Agents](/blog/building-second-brain-llms-ai-agents)


* * *

Liran Tal is the author of the book [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/)

[Start Building Secure Node.js Applications](https://www.nodejs-security.com/)

 [![](/_astro/nodejs-secure-coding-book-3d-style.DiTWpzFs_Z3c7s1.png)](https://www.nodejs-security.com/)
