How can I serve images from my own custom domain?

πŸ“ Note: For higher pricing plans (starting with Business 100K), you also get the ability to use your own custom domain name for the CDN-served images rather than an Optimole subdomain, something like

Here are the steps to set up a custom domain: 


Go to the Custom Domain tab and add the custom domain you will want to use instead of (eg. Please, make sure you use an existing domain/subdomain.


A certificate will be generated for the specified domain, and you will receive DNS Records to be added to your DNS Zone Editor for the domain configuration, ensuring certificate validation.

πŸ“ Note: Take note that a certificate must be validated within 72 hours from the time it was generated, or else it will expire.


After the certificate is validated, modify your wp-config.php so that you specify the usage of the new custom domain.

define( 'OPTML_CUSTOM_DOMAIN', '<user custom domain>' );

πŸ“ Note: The <user custom domain>  has to be replaced with your custom domain, as you can see in the above screenshot, or you can directly copy the code snippet. This code is valid if you have only one custom domain. For multiple custom domains, these can be selected when connecting the plugin.


You can verify that the custom domain is serving the images you added by inspecting the image URL.

πŸ“ Note: In the Images Domain (right panel of your WordPress Optimole dashboard page), you can observe that the name has been modified to match the custom domain you established.

If you encounter any issues at any of the steps mentioned before, you can let us know, and we will help you resolve any issues.

AWS Authorization

Depending on the hosting provider, you will have to allow AWS to validate certificates for you as specified here:

Just add the following authorities for your domain: CAA 0 issue "" CAA 0 issue "" CAA 0 issue "" CAA 0 issue ""

This should allow AWS to emit an SSL certificate for you and validate it.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.