How do I test images in WP migration without Changing URLs?
-
I'm redesigning example.com on a subdomain of my own site, so at example.mysite.com. As part of the redesign, I am optimizing the site's images. I used Wordpress Importer to get the content to the development site, but I did not import the images. Instead, I added the images to the development site by copying and moving over the contents of example.com's uploads folder. The posts at example.mysite.com are showing the images, but they are pulling them from the original location. I tried adding the following code to wp-config.php under the (misunderstood?) impression that the image URLs would use the development site's domain:
1 define('WP_HOME', 'http://example.mysite.com');
2 define('WP_SITEURL', 'http://example.mysite.com');I am not seeing any change and the images are still pulling from the original site. How can I test the images on the current site without actually changing the URLs in the database. (If I understand correctly, I could search and replace, but that is not what I am trying to achieve.) The original domain is not changing with the redesign, so there is no need to actually change the URLs. I just need to test the images, as I will be removing those that are not being used as well as optimizing the remaining images before moving the redesigned site over to the original domain.
-
If the images are coded into the website using "http://example.com/image.jpg" instead of "/image.jpg" then the images will always pull from example.com, instead if your test site.
If they were coded with "/image.jpg" then the code would pull from example.com when the page was there, and example.yoursite.com when you moved it over for testing.
-
I appreciate your response. I do not need to permanently change the urls, as the domain is not changing in the redesign. I just need to see that all the images I have edited are in place correctly on example.mysite.com. There must be a temporary/test solution.
-
It sounds like the URLs being used in the code aren't dynamic. There are two different ways to embed an image (and it's URL) on a page with html:
You can use a dynamic URL, where the domain will be whichever domain the page is on, like notice how there is no domain in front of the URL path, this means the domain will change depending on which website the code is on.
The other way, and the way it sounds like is being used on your site is This makes the URL definite, since all of it is defined. If you see that your images were put in with URLs like these, you'll need to make them dynamic to accomplish what you want to.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Botched domain migration
tldr: we consolidated several of our domains from longdomain.com to domain.com over a year ago and lost our highest value keywords, roughly 70% of our traffic. All our links were natural google loved our site up until that point. Things started to go sideways then... Oct 2016: 301 redirect everything from http(s)://(www).longdomain.com/* to https://www.domain.com/*, traffic starts to slump Jan 2017: Traffic has slumped 30-40% from normal seasonal levels Apr 2017: We experiment with Rankscience, implementation is botched creating a robots.txt disallow: / which is corrected in a week. traffic slumps even more during this period, but this issue seems to recover over the next month or two (hard to tell since now we have multiple factors and seasonal traffic). Oct 2017: Start an engagement with a seo firm that has experience with migration issues. They find some pages which are not redirecting and claimed that google is confused by that and pages we were redirecting wouldnt pass all the pr value until every page on our old site (including non public ones that google seems to have scraped from emails) was redirected over. Interm: Site audits from the seo form, many minor onsite improvements, link disvow, etc etc, no impact really. Current day: Stumped, and the business is hurting from the lost rankings and cost of seo. Those high value rankings are just gone and I did everything by the book as best I know. Redirects, same content, just punished. Up until the interacting with Rankscience and the seo firm, I handled all the serp related concerns myself. This has left me pretty disillusioned and at my wits end on where to look next.
Intermediate & Advanced SEO | | sonar0 -
Images not appearing in Google Images SERPS
Hi there We pushed a new version of our website live more than 6 months ago. So far, none of the images that are in the product gallery on this page http://www.ingleandrhode.co.uk/bespoke-rings/inspiration/ are appearing in the Google Images SERPS (I tested this by searching Google Images for "site:www.ingleandrhode.co.uk"). I understand that the gallery uses Javascript, so Googlebot doesn't see the image files in the HTML, but in Webmaster Tools, if I "fetch as Google" with rendering, this suggests that Googlebot does see the gallery images. My website developer tried adding an image sitemap about two weeks ago, which is being indexed, but so far this hasn't made any difference. Any suggestions on what needs to be done for these gallery images to start appearing in Google Images SERPS? Many thanks!
Intermediate & Advanced SEO | | TimIngle0 -
Why is this url redirecting to our site?
I was doing an audit on our site and searching for duplicate content using some different terms from each of our pages. I came across the following result: www.sswug.org/url/32639 redirects to our website. Is that normal? There are hundreds of these url's in google all with the exact same description. I thought it was odd. Any ideas and what is the consequence of this?
Intermediate & Advanced SEO | | Sika220 -
Authorship image
Do you understand google authorship? They removed the image from google but left the name. Cant understand what is wrong. It still shows up in testing.
Intermediate & Advanced SEO | | Joseph-Green-SEO0 -
Canonical url issue
Canonical url issue My site https://ladydecosmetic.com on seomoz crawl showing duplicate page title, duplicate page content errors. I have downloaded the error reports csv and checked. From the report, The below url contains duplicate page content.
Intermediate & Advanced SEO | | trixmediainc
https://www.ladydecosmetic.com/unik-colours-lipstick-caribbean-peach-o-27-item-162&category_id=40&brands=66&click=brnd And other duplicate urls as per report are,
https://www.ladydecosmetic.com/unik-colours-lipstick-plum-red-o-14-item-157&category_id=40&click=colorsu&brands=66 https://www.ladydecosmetic.com/unik-colours-lipstick-plum-red-o-14-item-157&category_id=40 https://www.ladydecosmetic.com/unik-colours-lipstick-plum-red-o-14-item-157&category_id=40&brands=66&click=brnd But on every these url(all 4) I have set canonical url. That is the original url and an existing one(not 404). https://www.ladydecosmetic.com/unik-colours-lipstick-caribbean-peach-o-27-item-162&category_id=0 Then how this issues are showing like duplicate page content. Please give me an answer ASAP.0 -
Google tagged URL an overly-dynamic URL?
I'm reviewing my campaign, and spotted the overly-dynamic URL box showing a few links. Reviewing it, they are my Google Tagged URLs (utm_source, utm_medium_utm_campaign etc) I've turned some internal links to Google Tagged URLs but should these cause concern?
Intermediate & Advanced SEO | | Bio-RadAbs0 -
The format for image SEO
Hi there. After looking at a few SEO videos relating to image SEO it seems important to ensure images are SEO'd just as well as pages. I however have a question. If the page is Meta titles the following: Online for Equine | Riding Clothing | Just Togs Latina Ladies Breech And this particular page contains five images which are each variants of this product, how is it best to SEO them? Would you go with the: Online for Equine | Riding Clothing | Just Togs Latina Ladies Breech Front Online for Equine | Riding Clothing | Just Togs Latina Ladies Breech Back Online for Equine | Riding Clothing | Just Togs Latina Ladies Breech Side and so on... Or would this result in keyword stuffing with Google's new over-optimisation rules. Would it be better to rename them so they are all individual? I am considering deleting the images, renaming them on the server as the SEO proof name and then re-uploading them so the Image caption = filename. Am I on the right track? If you need the page: http://www.onlineforequine.co.uk/jodhpurs-breeches/22-just-togs-ladies-latina-denim-breech.html
Intermediate & Advanced SEO | | onlineforequine0 -
What To Do For A Website That is Mainly Images
I have a website that is a desktop wallpaper script. People can come and upload 100's of wallpapers to share with the community. This is were the problems comes in. Files are normally called 27636dark.jpg or whatever and come with no description. This leads to 2 things. no text content that google can use to know what the page/image is about. Meta descriptions, URL's just look like spam. Example: /car-wallpapers/7636dark.jpg If a text description was added, it would still only be like "Green Trees in the distance". Which as you may guess, with 1,000's of wallpapers... would end up having a lot of descriptions the same. Is there any advice for sites that focus on image driven content?
Intermediate & Advanced SEO | | rhysmaster0