admin管理员组

文章数量:1289517

For instance,My image url is

.jpg

I want change it to

/wp-content/uploads/2021/07/x-600x600.jpg

Or

/wp-content/uploads/2021/07/x-600x600.jpg.webp

I want to know how to do it in function.php ? Or use a plugin ?

Please HELP THANKS.

For instance,My image url is

https://aa/wp-content/uploads/2021/07/x-600x600.jpg

I want change it to

https://images.s3.us-east-2.amazonaws/aa/wp-content/uploads/2021/07/x-600x600.jpg

Or

https://images.s3.us-east-2.amazonaws/aa/wp-content/uploads/2021/07/x-600x600.jpg.webp

I want to know how to do it in function.php ? Or use a plugin ?

Please HELP THANKS.

Share Improve this question asked Jul 6, 2021 at 7:46 Harvey WangHarvey Wang 32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Most of the cache plugins have built-in CDN settings. If you are looking for a simple solution for the image URL only, you can use CDN Enabler. It is from KeyCDN but you don't have to use KeyCDN for it to work. Simply Write your alternative domain to only use image extensions if you don't want to keep CSS, JS, etc in the subdomain.

If you want to do it by a filter, There are other works like creating an options panel so that you don't have to hardcode the domain, etc.

本文标签: How to change images url in functionphp