I got a BenQ FP72E Size 17-Inch LCD PC Monitor

Yes I got another web development device in my collection called BenQ FP72E Size 17-Inch LCD PC Monitor collected from Dubai. Before that I was using my Fujitsu LIFEBOOK L series LH531 model. So now you can say I can review or test my web development works on a larger display . Actually it’s not the major but it’s just useful when I need to test my work on a larger display. I will work on my laptop display normally and will test on it if required.

Another things optionally is, I love watching movie when I am a bit free or when I am too much busy with my programming work! I have a collection of movie around 120 above. It’s great to watch HD movie on this new 17-Inch LCD display. On my old one Fujitsu when I was watching a movie that was also perfect but not like now on my 17-Inch new monitor. I really love it!

Replacing media urls on wordpress posts

Sometimes we work for a website with wordpress keeping the development version on sub directory. Say are working for http://www.example.com website and currently it is live and we work for it’s new version in wordpress. So we setup a new wordpress version on new folder so the current development version is http://www.example.com/new

When we are done with all development and uploaded all contents on that new setup that means all media files and contents media urls are targeting with http://www.example.com/new

So when we are going to make the site live we need to do something manually to replace media paths for contents. Or if we directly copy contents from another hosting in that case same things will happen.

For the faster replacement of each media guid, contents media url or other meta values below mentioned 3 mysql query is nice.

Note: After running below code we need to ensure that all wp-contents/uploads folders contents are available as it was on new development directory.

update wp_posts set guid = replace(guid, 'http://www.example.com/new', 'http://www.example.com')

update wp_posts set post_content = replace(post_content, 'http://www.example.com/new', 'http://www.example.com')

update wp_postmeta set meta_value = replace(meta_value, 'http://www.example.com/new', 'http://www.example.com')

update wp_options SET option_value = 'http://www.example.com' WHERE option_name = 'home' OR option_name = 'siteurl';

 

With this above queries below listed things will happen –
1. Replace all resource or post guid
2. Replace all old media src url to new src url in post contents
3. Replace all meta resource url like image, video or audio etc
4. Replace site home page and siteurl url