Host Images of WordPress Blog in a Subdomain for Better Speed

Page load time is an important metric for Google search ranking. The webpages with better loading time will rank better in the Google SERPS. In some previous articles, I’ve described about how to reduce the page load time of your WordPress blog [ 1. Speed Up  Blog Improve Page Load Time 2. Install Contact Page Without Any Plugin3. Reduce Page Load Time ] .  Another issue is still yet to discuss that effectively participate in your page performance. By default the images of your site are hosted in the same domain. This slow downs your page speed. Because, almost all the browsers create maximum two-four connections when downloading a page from the web server. So if your pages contain more than one images then it is wise to host those images in another domain so that the browser can download the images in parallel with your main domain. WordPress does not support hosting images in different domain. But fortunately, it supports and allows you to host images in a subdomain. This article is about how to host your website post images in a subdomain along with the old images that were hosted in the main domain.

Create a Subdomain for your site

In order to get your subdomain you’ve to log-in to your domain control panel. Point to Subdomains and create your subdomain, provided your domain resides under /public_html/. Note: The facility depends on your hosting provider. So if you are unable to create a subdomain then contact your hosting provider.

Change default image  uploading folder in WordPress

This step involves in setting WordPress to change the default uploading folder for the post images. log-in to your WordPress dashboard. Click on “Miscellaneous” “Media” under “Settings” from left side of the dashboard.

Fill up the fields as follows: Store uploads in this folder : images Full URL path to files : http://images.yourdomain.com

Click on “Save Changes”. Now whenever you will upload any image to your post, the images will be uploaded in the subdomain http://images.yourdomain.com.

Update the old post images location

You’ve just changed the upload location of your post images. So the images of the new posts will be uploaded in the subdomain. But what about the old post images? Changing the location of all the old images one by one is a stupid job. So at first download all the folders containing the images under /public_html/wp-content/uploads/ from your server. Upload all those folders in the folder /public_html/images/. Now you have to execute a simple SQL query on your database. You can do this from the phpMyAdmin in your domain control panel. Click on phpMyAdmin > select your database from the left side > click on the “SQL” tab. Now put the following query in the box

UPDATE wp_posts SET post_content = REPLACE(post_content,'http://www.yourdomain.com/wp-content/uploads/','http://images.yourdomain.com/')

Click on “GO”. This query will replace “http://www.yourdomain.com/wp-content/uploads/”  with “http://images.yourdomain.com/” in all the image location URL. To update the images links in the media library run the following sql command:

UPDATE wp_posts SET guid = REPLACE(guid,'http://www.yourdomain.com/wp-content/uploads/','http://images.yourdomain.com/')

Redirect the old images link to to subdomain

You have completed all the task with your site and database. But Google has crawled and indexed your old images. So redirect the old image urls to the new image URLs to let Google know that those images are same. To do so add the following line in your .htaccess file

RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://images.yourdomain.com/$1

Reminder: Backup your .htaccess file before any change. That’s all to set your subdomain as post-images upload location.

Now this is time to tweak your website for better performance with great page load time. You can use various tools to optimize your website as well as you can view the page load times for your pages right from your Google Analytics account.

Any question is always well come. Put your reaction in the comment section.

Comments

  1. Sariyanta

    Hi Tanmay, this is a good article, and i apply it already on my website http://www.rokocountrybarak.co.cc
    By the way, can i also put my image themes in my subdomain? and what should i do in order to make everything correct. I want to do this because my theme is kind of heavy theme

  2. Tanmay

    @Sariyanta
    Happy to know that you found our article useful. Thanks for your nice words. By the way I could not understand what you’ve wanted to do. Do you want to keep the theme in subdomain or the theme images?

  3. Sariyanta

    That is fast response, thank you, i appreciate your attention.
    What i intend to do is to move my image theme into sub domain.
    One more problem, when i try to upload an image to my subdomain, it showing something like this
    The uploaded file could not be moved to /home/xxxxxx/public_html/img/2010/06. and my subdomain is img.mydomain..
    can you help me?
    thanks for your time

  4. Sariyanta

    one more thing, what about css and js file? do you have an explanation about this?

  5. Sariyanta

    Hi again Tanmay, i want to move all the theme in subdomain, and also i want to create another subdomain to store my script file, is that possible? if its possible then how to do it? i’ve tried googling but nothing makes sense to me, i am a newbie, so this kind of article with a complete tutorial will be very helpful.
    thank you.

  6. Tanmay

    @Sariyanta,
    No, you can’t upload the theme in a subdomain. But obviously you can move some theme templates in the subdomain and call them properly from your main theme templates. The same can be applied for the css and javascript templates.

  7. Sariyanta

    Okay, thats sounds good, so now i want to host my css and js in my sub domain, how should i call it? which file should i edit? sorry i’m newbie and asking so much question

  8. Tanmay

    Put the following
    link rel=”stylesheet” href=”your style-sheet location” type=”text/css” media=”screen” />
    replacing the existing one in the header.php.
    Similarly, apply that for javascripts location in that same template header.php.

    Never mind about that. Feel free to ask any question. We are happy to help you. You can subscribe to our RSS feed or Daily news letters from the top of the site. Keep coming.

  9. Jay

    Really interesting post. I have only just started using WP3 Cache to try and improve my page speed due to sudden increase in traffic however, if that doesn’t turn out well, I will give your images sub-domain suggestion a try and feedback to you.

  10. lemmekillmister

    Hi Tanmay,

    I have implemented this subdomain and the CDN on a site that i built but right now, i am having a problem with the https.
    When the site is visited through https, i have all my images and javascripts pointing to http://images.demi.com/web/images/x.gif.

    The site loads but with an alert in IE asking for user confirmation because it has both secure and unsecure data on the web page.

    My question to you would be , is there an easy way to get around this problem and let the browser use https when it is https and http otherwise.. ( a relative url something starting with images.demi.com ,without specifying the entire path starting with http)

    I tried this and it does not work
    <img src="images.demi.com/web/images/x.gif" …
    but this works with http
    <img src="http://images.demi.com/web/images/x.gif" …

    Any help is really appreciated. Thanks in advance
    Lemme

  11. Tanmay

    @Lemmekillmis: Thanks for putting your idea here. By the way, I don’t know even if WordPress supports both http and https at the same address. But I’ll make a research on it. Thanks again for sharing. Hope I can help you on this matter.

  12. Tanmay -

    Thank you for your post! I was actually searching for another topic and discovered this. I think that I will implement this on a less important site to ensure I understand everything. Once I do, I will implement on my main site, http://www.AllAboutGratitude.com .

    Is there anyway to benchmark before and after load times (easily)? I have found that some plug-ins are the real culprits of degradation of page load times so I have deleted them. I should probably delete a couple still!

    Again, thank you. Sorry for the long comments.

    Be Well.
    Paul.

  13. Ram

    Hi how to do this in wordpress 3

    • Tanmay

      The procedure for WP 3 is same as mentioned in this post. Follow the instructions and let me know if any problem arises.

  14. This is a great tip! Works like a charm for 3.0.1. However when creating a child directory within the subdomain, the flash uploader is not recognizing the child directory? it creates the images directory within the wordpress files. Any ideas?

    Store uploads in this folder: images/directory-name
    Full URL path to files: http://images.mydomainname.com/directory-name

  15. Tanmay

    @Gymgangsta: did you check the file permission for that directory?

  16. Hi Tanmay,

    I did check permissions, made the directory 777, no luck. I did not check the permissions for the subdomain “images” you think that is the problem? My paths are correct right?

    cheers for the fast response and for your code above, it is really a timesaver…

  17. Tanmay

    I think some thing wrong that is preventing the image directory recolonization. I also use this method for this blog and working fine. But how can I find problem with out seeing the code? Can you send a screen shot of the media setting? You can upload that from http://www.techtipsgeek.com/go/up/ . Feel free to ask more question.

  18. i listed my settings above: here it is again.

    Store uploads in this folder: images/directory-name

    Full URL path to files: http://images.mydomainname.com/directory-name

  19. Tanmay

    I can’t understand what the hell is going on. You can try the following

    1. Type the full location of the folder at “Store uploads….files:” like /public_html/images/your-dir
    2. log out from WP and then log-in again. Then try to upload.

    If those does not solve then you can submit you site to our service section. http://www.techtipsgeek.com/services/ . Don’t worry, it is free for you.

  20. Thanks Tanmay, I’m quite savvy with wordpress, and this stumps me too. I’ve tried a few things, letting wordpress create the directory (so it has ownership) etc, I’ve tried various path combos, I’ll try your suggestions tomorrow when i am back at the grind again.

    cheers! =)

  21. Hi Tanmay. I tinkered with it some more and am thinking this. My wordpress is installed in a subdirectory (www.mydomain.com/wordpress/

    and no matter what path I set for images to my subdomain (images.mydomain.com) it wont show up. I’m thinking it’s an .htaccess problem and not a permissions problem. I’ve got some crazy stuff in my htaccess. So i’m gonna just upload these images into the content/uplaods folder then move them manually and specify the correct link.

    =)

  22. Hi again Tanmay, on a side note…. I did the same thing for videos. I created a http://videos.mydomain.com and noticed my 404 error logs (in the redirection wordpress plugin log) are reporting /crossdomain.xml

    further investigation leads me to a confusing doc: http://kb2.adobe.com/cps/142/tn_14213.html

    maybe you could write an article on what would be the perfect code for the crossdomain.xml and exactly where it goes.

    I gather the file crossdomain.xml resides at the root of http://www.mydomain.com so that it can serve up flash video from the subdomain: http://videos.mydomain.com

    the code would be:

    cheers !

  23. Jim

    Well written sir.

    Of course the other alternative is to host all images on a free hosting site like image shack, flickr or Picasa, and referencing them from the blog. Two benefits are that it allows me to avoid bandwidth and relies on their server speeds.

    Can you comment on the benefits and concerns of a subdomain vs. a remote host?

  24. Tanmay

    Jim: Your points are really appreciating. But they all end at one question. How much do you depend on a third party service about the security issue of your assets?

  25. Jim

    Good point Tanmay. Although if Flickr or Google has security issues, there will be a much larger issue than just my blog! haha.

    Actually, I almost always use others’ pictures available in the Commons to illustrate my posts, so my personal pictures are not in general at risk.

  26. Kunal

    @gymgangsta:- the problem is in your image upload file path.

    If you are on shared host,you need to use the entire path right from /acc/public_html……..etc

    Hope this helps.

    BTW,thanks Tanmay :)

  27. Tanmay

    John, just delete the paths that you’ve provided under the Miscellaneous settings.

  28. Hi Tanmay, great article.

    One question, if i want to store my data on another domain (not-subdomain), how should i set uploading setting from WP?

    I mean instead of having http://static.domain.com/img/xyz.jpg
    i want to use, http://www.staticdomain.com/img/xyz.jpg

    I’ve read some articles and realized that another domain option is way much better.

    What do you think?

  29. Tanmay

    Mustafa: If you are in WordPress then it does not allow to host images/videos in different domains.
    What You have read about the different domain is hosting your assets in different domain boosts your blog performance. And the subdomain works like a different domain in that very purpose.
    You cam also host your images from some Content delivery network (CDN). But there also, the domain name should like a subdomain. e. g cdn.amazon.com.

    Atlast,
    if you want not to use subdomain then host them in another domain and insert the link in your WOrdPress blog. But you will not be able to upload or manage those images/videos from your WordPress blog (main domain).

  30. eGosip

    Hi, nice sharing…
    I have blog about Celebrity Gossip and I need to host media library in other hosting.
    Please tell me how to configure it.

    Thanks

  31. laptopy

    I was suggested this web site by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my problem. You’re amazing! Thanks!

  32. Prishtine

    Thank you so much with regard to giving me an update on this topic on your site. Please know that if a brand-new post becomes available or if any improvements occur about the current post, I would be thinking about reading a lot more and learning how to make good usage of those strategies you talk about. Thanks for your time and consideration of others by making this web site available.

  33. Decio

    I’m reading about this issue on google, but it seems to me it would be easier to use the Supercache plugin and cache it somewhere else via CDN. Less hassle, wouldn’t it?

  34. Tanmay

    Decio: Yes, you can setup this via Supercache plugin. Many people do not use Supercache or such plugin. This method should help them a lot.

  35. Hello Tanmay,
    i have question. i have two domain for say domain1.com and domain2.com if i upload all my images at domain2.com and call images from there for domain1.com then would domain2 will have any benefit for this

  36. remember : to be the best for SEO you can host images in a subdomain –> not other domain e.g images.mmm.com (not images-name.com and your site is eg.com)
    When a visitor come to see your images in images search or someone copy your images – –> it;s been count for your site ….

  37. Tanmay

    In this case all your images will be indexed in Google with domain2. But I think that will not benefit domain2 so much as Google does not like the domain without any text.

  38. Ankit

    Hey tanmay i am still unable to upload the images on my blog as it is uploading on my old domain. i have change the required settings exactly as you told. although now my blog is calling all the images from my new domain but unable to upload it on new domain.
    if possible can you please tell me how to change settings from functions.php what i need to change in functions.php so that all my images uploads from my new domain………

  39. Tanmay

    Sorry Ankit. I forgot to update the article. Go to Settings > Media instead of Miscellaneous. I also updated this post. Now follow and let me know if you are able to upload your images to your subdomain.

  40. Ankur

    Hi Tanmay i currently have a website hosted on server that are almost private so no problem regarding speed and other issue but there is limitation regarding webspace i have only 1 GB, is there a way to host my files on different host (No CDN service like amazon) i mean like free webhosting out there, is there a way to use them..

  41. Decio

    @Ankur
    You can host you entire site for free on google app engine. Search for google app engine static and follow this tutorial:
    http://www.labnol.org/internet/host-website-on-google-app-engine/18801/

  42. Li-An

    What about SEO ? I manage a blog based on images and accept hotlinking as Google count them as valid link to my site. What will happen if I move them to subdomain ?

  43. Andre

    Hi Tanmay. I’m not sure if this is possible with WP, but if read/write permissions are not an issue, could this method be used to get WP to store images on a completely different server through a different URL?

  44. Tanmay

    WP means WordPress? If so then this tutorial is completely working for WordPress. This tutorial only allows you to host images to a subdomain of your main domain.

  45. Andre

    Yes, my apologies, I generally refer to WordPress as WP, makes it easier to write.. Thanks for the prompt response, I guess I’ll have to keep hunting for a plugin to do this then. I’m sure it must be possible somehow, I just haven’t found out how yet…

  46. Tanmay

    @Andre: If you really want to host your images in different domain Try some CDN like Amazon : http://aws.amazon.com/cloudfront/

  47. Andre

    Thanks Tanmay, this was something my brother asked me to look into. He was asking me if WordPress was capable of using photos he currently has in some Google-based storage (I think he meant Google Docs, but I’m not sure). So when I found this blog post I thought I’d at least ask and see.

  48. Charles D

    I’ve been looking for an idea like this. I was going back & forth between hosting images on the domain, and using a image hosting service. I’m giving this a try next, thanks for the tip! :)

  49. Thanks for the detailed guide.. i am planning to change my webhost next month and decided to move images to a sub domain.., mu query is whether to host images in the same web server or use a CDN network for hosting images??

  50. Amar

    Hi Thanks for tips. its really cool.I have configured everything as mention in your post. I am not having issue with old images but while i uploaded new images it went to old wp-content/uploads directory. I would like to mention here that i have configured ” Full URL path to files” as instructed in post. While full url path is set then why images are getting upload in default directory? Please help me.

  51. Amar

    HI. My problem has been solved. Thanks. I must say your writing is simple and complete and I really appreciate that. Most of tips or tricks available on net are half written or sometimes i do not get idea that what writer asking me to do. Labnol is one of finest technical blog but while you read-how to setup image folder for wordpress, you lost some where because of half written article. Please continue simple and complete writing. Thanks

  52. Hi, thanks for this post.

    Been really struggling trying to set this up with my host (123 Reg).

    They are basically saying that what I’m trying to achieve (which is what this post is about) is impossible.

    I’ve purchased a subdomain from them, and when I follow the guidelines set out in this article, I get a SQL error message

    “The this error pos up at the top : #1146 – Table ‘aminearlythereyetco_837484_whatever..’ doesn’t exist”

    They have provided me with a work around, but I’m not sure whether it’s the right thing to do… this is what they have proposed..

    “You can load you images into a folder on your hosting package and make that url (aminearlythereyet.com/folder/photo.jpg or aminearlythereyet.com/folder) live. Then you will have to create a framed fprwarding rule in order to forward your subdomain to that specific url by following the steps from this link: How do I add 302 (Temporary) Web forwarding?
    Also the media.aminearlythereyet.com subdomain will have to be pointed to the webforwarding IP address 94.136.40.82 by following the next steps:
    log into your control panel, select the aminearlythereyet.com domain from the drop-down list and click “Manage”
    click on “Manage DNS” button an then on the “Advanced DNS” tab
    point the “media” record to 94.136.40.82 instead of 94.136.40.103
    Please note that any DNS change needs time to propagate 24-48 hours. This way when you will access media.aminearlythereyet.com you will be forwarded to aminearlythereyet.com/folder/photo.jpg and the url in the web browser will be media.aminearlythereyet.com.”

    Any advice would be really helpful. Thank you very much!
    Stuart

  53. Hello and Thank You for this great post. I followed your directions and it seems some of my images are updated and working and others will not work. I have even tried uploading the images from pc and replacing them with the updated image and they will not appear. I am lost and could certainly use someones advice or help. My pages are a mess now and I dread manually recreating everything. I’m sure there is a painless way to fix my problem. If anyone with more database experience would give me a hand, it will be greatly appreciated. Thanks in advance for any support.

  54. BeautyPirate

    For some reason it only worked like this for me:

    Did NOT work:
    RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://images.mydomain.com/$1

    DID work:
    RedirectMatch 301 /wp-content/uploads/(.*)$ http://images.mydomain.com/$1

    Part from that, easy to follow tutorual!

  55. Sir, I want to know that, If i change my upload path as subdomain for my future posts without moving old images to subdomain .. then will it give any error ??

  56. gaurav

    great information. I am a novice in wordpress and own a website and i need at least 3 images in a single post, i am using photobucket pro account to host the images and insert them into my post but recently i have started reading about SEO from images and found that it is better to host images on the same domain for better ranks but i am confused where should i have images and what will be better for seo. Will saving images in subdomain is better for seo or just just make mywebsite/Imgaes to store them.Some people say that search engines see subdomain as another domain it will not be good for seo? please suggest me what should i do to get better SEO

  57. Beatrice

    I have WordPress 3.3.1 and tried the suggestions here but am running into some problems. I made a subdomain within my cPanel called “media” – my wordpress installation is on the root of my domain (not in a subfolder). This is how I set it up in Settings > Media:

    Store uploads in this folder: /media (it’s on the root public_html/media)
    Full URL path to files: http://media.mydomain.com

    Without the beginning slash in /media WP just makes a folder called media within the wp installation, which defeats the purpose of parallelising.

    With the beginning slash in /media, I get the following error whenever I try to upload an image:

    Warning: copy(/media/imagename.jpg) [function.copy]: failed to open stream: Permission denied in public_html/domainname.com/wp-admin/includes/file.php on line 348
    1557

    Line 346-349 of file.php says:
    // Copy the temporary file into its destination
    $new_file = $uploads['path'] . “/$filename”;
    copy( $tmp_file, $new_file );
    unlink($tmp_file);
    Line 348 specifically is the copy ( $tmp_file, $new_file );

    If I leave “Store uploads in this folder” blank, I get no error, and after “crunching” it shows the correct filepath (http://media.mydomain.com/imagename.jpg) but it’s not actually uploading it there. When I check on the server, it’s not there at all!

    I’m really hoping you can help me – I contacted my hosting company, and the subdomain folder is CHMOD 755 so the permissions are not preventing WP from writing to it directly.

    I don’t know how to fix this so I can use my subdomain to properly parallelise images on my WP site…

  58. julian

    i tried your tips, it was almost succes, i still had problem with the galery link, before it was posturl/images name.jpg, but after moving to subdomain it is become, post url/sub.domain.com/imagename.jpg

    is there any =one can help me??

  59. Tanmay

    Just do everything with high concentration. There are two database updates there. The first one to change the source url of your blog images. And the second one is to change the link url of the images. when you run the sql query, make sure that the old url part and the new url part are written properly….suppos you had the old image url as

    http://www.yourdomain.com/folder/xyz.jpg

    now after moving them at your subdomain, it should be

    http://sub.yourdomain.com/folder/xyz.jpg.

    so the sql query for that update will be

    UPDATE wp_posts SET guid = REPLACE(guid,’http://www.yourdomain.com/’,'http://sub.yourdomain.com/’)

    Once again if you want to put the images at another folder name or location instead of the same name as it was before you can cleverly make your query to replace the older url with the new path…

    You can ask any time with your specific query here. Thanks for your comment.

  60. mrPerezMarc

    I’d like to expand on your Idea. How would you go about loading image from 2 different host name pointing to the same image folder?
    so if you have 10 images, 5 are loaded from images1.mydomain.com and the 5 others are loaded from images2.mydomain.com

  61. Hi i made subdomain and poninted images to uploadin in subdomain

    but instead of uploading in image.domain.in it is uploading in domain.in/http://images.domain.in

    here domain is my domain……..please reply faster

  62. bappaditya

    Good tricks. thanks for sharing with us
    I just follow your advices and its work .
    My page load time reduce to half
    Thanks once again.

  63. I’ve just managed to move all my post images in a “cookieless subdomain” and serve them in this format (path) when a user accesses the post: img.domain.com/year/month/file.jpg (1)

    Now all my old images have this format but everytime I create a new post and upload an image, the image path shown is this: domain.com/img/year/month/file.jpg (2)

    So what I’m trying to do is to force the site/server to use (1) instead of (2).

    I’ve already tried everything in Media Settings tab, the only thing working is to write in the “Store uploads in this folder” and “Full path to files” fields the subdomain name (“img” that is).

    The path for images in your article are the best example.

    Any suggestions?

    I’m thinking is a Cpanel setting I’m doing wrong.

    Many thanks!

  64. Ok, thanks for your reply. I’m worried though that there’s nothing to propagate since it’s just a subdomain with images and not a CNAME change for A records.

  65. Hi.

    Yes, the subdomain is working fine, I think all the settings are correct there. And yes again, the site address I’m using is the one with the problem.

  66. Tanmay, yes, all the images are serving from subdomain at this point because I haven’t published any other post since.

    As you can see, since I’ve posted my first comment to this moment, there is no new post.

    But I have tried to post new stuff and the images turn the unwanted path.

    Any other ideas that might help, please?

    Thanks!

  67. Tanmay, I think I might’ve made it completinmg your indications here with this: http://wordpress.org/support/topic/uploads-folder-outside-wp-root?replies=13

    the “/home/user/public_html/images” does the trick!
    Although I’ve just found that setting “define” cookie domain in wp-config is making the admin and any user unable to login. So I’m kinda back to where I’ve started but at least the first part, serving the path correctly is happening.

    Thanks so much for your assistance!

  68. Hey guys,

    I have a question! I recently made a sub-domain for the website, images.clayhowardsmith.com I followed the instructions above, but I’m having some issues. I’m using wordpress to manage my site and now when I try to post something new the images appear as broken files. I changed the upload direction to my images sub domain, but it still isn’t working!

    Any ideas would be appreciated,

    Clay

  69. pgrytdal

    Hello!

    I have done this with a fresh install, and when I try to upload images, I get this error:

    “NAME.png” has failed to upload due to an error
    Unable to create directory /images/2012/06. Is its parent directory writable by the server?

    Whats wrong?

  70. Tanmay

    @Pgrytdal: You should make the directory /images writable visiting your hosting conntrol panel or using FTP client. If you are not familiar with that, contact with your hosting provider.

  71. Vaibhav Bathla

    Hello

    Its not working for me. Image gets uploaded but when i copy the link it shows “500 Internal Server Error”. I have wordpress installed in a sub directory named WordPress (public_html/Wordpress) but the sub domain is in the root directory i.e public_html/images.

  72. I have done all the steps. Images are also being loaded from sub-domain but I have a problem. When I apply the htaccess file redirect, it is also redirecting my other domain images hosted in the same hosting account to the same sub-domain. Further explanation :

    I have 2 websites geekyminds.com and geekyinspirations.com . I want images for geekyminds.com to render from images.geekyminds.com . But when I apply your redirect (RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://images.yourdomain.com/$1) , it is also redirecting my other site’s images. Please give a command that is domain specific. I played around but could not find a specific solution. Do reply urgently.

  73. Hi Tanmay,

    Thanks for the detailed illustrations. I have a doubt though. I have quite a large number of posts in my blog and many of my images ranks very well in search results.

    So If I don’t run the sql query to update existing image paths, would it be possible that the older images load from same directory and any new blog post will automatically start uploading images to subdomain folder?

    I hope you understood my point.. Basically I want to keep my existing images folder in the wp-content folder itself and move future uploads to subdomain folder.

  74. @Tanmay I didn’t get you. So asking the same question again….

    Can I skip the sql query part to update old posts images links so that the old images still remain in the same wp-content folder and new images are automatically saved in subdomain folder?

  75. Yes!! You can skip that part i.e you do not need to run this query :

    UPDATE wp_posts SET guid = REPLACE(guid,’http://www.yourdomain.com/wp-content/uploads/’,'http://images.yourdomain.com/’)

  76. Barry

    OK, great tutorial, however, I worked for existing featured images, but I cannot add pictures anymore. I can insert pics in the products/messages but I cannot set pictures as featured images. The picture turns blank. If I resize the image i can see it…when I edit and save it..blank again. weird. Who knows what to do? and I I can’t make it work? how do I reverse these action in the SQL server?

Speak Your Mind

*