Title: wp_get_attachment_url returns http not https
Last modified: July 12, 2018

---

# wp_get_attachment_url returns http not https

 *  [mwahlmann](https://wordpress.org/support/users/mwahlmann/)
 * (@mwahlmann)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/wp_get_attachment_url-returns-http-not-https/)
 * the function wp_get_attachment_url returns http instead of https if cloudflare
   https is enabled. This causes a mix-content warning in the browser for some of
   the assets (using for instance unyson plugin) to solve that you could add the
   following filter:
 * add_filter(‘wp_get_attachment_url’, function($url) {
    return set_url_scheme($
   url, ‘https’); }, 999);

The topic ‘wp_get_attachment_url returns http not https’ is closed to new replies.

 * ![](https://ps.w.org/cloudflare/assets/icon-256x256.png?rev=2471183)
 * [Cloudflare](https://wordpress.org/plugins/cloudflare/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cloudflare/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cloudflare/)
 * [Active Topics](https://wordpress.org/support/plugin/cloudflare/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cloudflare/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cloudflare/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mwahlmann](https://wordpress.org/support/users/mwahlmann/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/wp_get_attachment_url-returns-http-not-https/)
 * Status: not resolved