PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 30, 2022

[FIXED] Wordpress: Serve images from a CDN

 January 30, 2022     cdn, wordpress     No comments   

Issue

I use a CDN to serve my images, which I upload into Wordpress. My settings were:

enter image description here

It worked perfectly but it doesn't work anymore since I updated to Wordpress 4.5. This are my settings now:

enter image description here

This filter doesn't work either:

function my_cdn_upload_url() {
   return 'http://media.mydomain.com';
}
add_filter( 'pre_option_upload_url_path', 'my_cdn_upload_url' );

Does anyone know how should I serve my images from a CDN?

Thank you.


Solution

The easiest way is editing the content of "upload_url_path" in the wp_options table:

upload_url_path > http://media.mydomain.com

Thank you!



Answered By - retroriff
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing