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
-
Migration to a new domain
Hi everyone, So i have one project where I'm planning to move current content on new domain, two reasons: 1. It seems current domain has some google penalty (backlink related, not manual) 2. Client wants rebranding and already has domain with new brand name. So as content is high quality and there is no content related penalty from google, what would be the best way to migrate existing content without passing any penalty AND without Google treating it as duplicate content. If i do 301 i suspect any penalty there is might follow, if i just copy existing content it won't be original content, what is the best solution here? Thanks
Intermediate & Advanced SEO | | joelsemy0 -
Migrating From Parameter-Driven URL's to 'SEO Friendly URL's (Slugs)
Hi all, hope you're all good and having a wonderful Friday morning. At the moment we have over 20,000+ live products on our ecomms site, however, all of the products are using non-seo friendly URL's (/product?p=1738 etc) and we're looking at deploying SEO friendly url's such as (/product/this-is-product-one) etc. As you could imagine, making such a change on a big ecomms site will be a difficult task and we will have to take on A LOT of content changes, href-lang changes, affiliate link tests and a big 301 task. I'm trying to get some analysis together to pitch the Tech guys, but it's difficult, I do understand that this change has it's benefits for SEO, usability and CTR - but I need some more info. Keywords in the slugs - what is it's actual SEO weight? Has anyone here recently converted from using parameter based URL's to keyword-based slugs and seen results? Also, what are the best ways of deploying this? Add a canonical and 301? All comments greatly appreciated! Brett
Intermediate & Advanced SEO | | Brett-S0 -
Crawl Test Question
Good Morning, I am just looking for a little bit of advice, I ran a crawl report on our website www.swiftcomm.co.uk. I have resolved most of the issues myself, however I have two questions;- Screenshot image http://imgur.com/VlFEiZ2 Highlighted blue, we have two homepages www.swiftcomm.co.uk and www.swiftcomm.co.uk/ both are set with a Rel-Canonical Target of www.swiftcomm.co.uk/. Will this cause me any SEO issues and or other potential issue? If this may cause an issue how would I go about resolving? Highlighted yellow, Our contact and referral-form are showing as duplicate title and meta description. Both of these pages have separate title and meta desc which it does seem to be detecting. If I search the page in google it returns the correct title and meta desc. The only common denominator behind these pages is that both have php pages behind them for the contact form. Do you think that the moz crawl may be detecting the php page over the html? Could this be cause any issues when search engines crawl the site? Kind Regards Jonathan Mack VlFEiZ2
Intermediate & Advanced SEO | | JMack9860 -
Best SEO url woocommerce, what to do?
Hi! Today we have our product categories indexed (by misstake) and for one of our desired keywords, a category have the nr 1 rank. By misstake, we didnt set nofollow, noindex on our categories, just tags, archives etc. We are now migrating to from Ithemes Exchange to Woocommerce and ime looking on improving our SEO urls for the categories. For keyword "Key1" we rank with this url: http://site/product-category/Key1. The seo meta title and description where untouched when we launched the site last spring so it doesnt look so good.. The plan is to stripe out product-category and instead ad some description ( i have a newly written text of 95 words, 519 letters without space with they keyword precent 5 times in a natural way ) to that particular category and have the url as following: http://site/key1 and then have a 301 redirect for the old http://site/product-category/Key1. What do you think of this? What shall i consider? on the right track? Grateful for any help! // Jonas
Intermediate & Advanced SEO | | knubbz0 -
Which URL is better for SEO?
We have a URL structure question: Because we have websites in multiple countries and in multiple languages, we need to add additional elements to our URL structure. Of the two following options, what would be better for SEO? Option 1: www.abccompany.com/abc-ca-en/home.htm Option 2: www.abccompany.com/home.abc.ca.en.htm
Intermediate & Advanced SEO | | northwoods-2603420 -
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 -
301's, Mixed-Case URLs, and Site Migration Disaster
Hello Moz Community, After placing trust in a developer to build & migrate our site, the site launched 9 weeks ago and has been one disaster after another. Sadly, after 16 months of development, we are building again, this time we are leveled-up and doing it in-house with our people. I have 1 topic I need advice on, and that is 301s. Here's the deal. The newbie developer used a mixed-case version for our URL structure. So what should have been /example-url became /Example-Url on all URLs. Awesome right? It was a duplicate content nightmare upon launch (among other things). We are re-building now. My question is this, do we bite the bullet for all URLs and 301 them to a proper lower-case URL structure? We've already lost a lot of link equity from 301ing the site the first time around. We were a PR 4 for the last 5 years on our homepage, now we are a PR 3. That is a substantial loss. For our primary keywords, we were on the first page for the big ones, for the last decade. Now, we are just barely cleaving to the second page, and many are 3rd page. I am afraid if we 301 all the URLs again, a 15% reduction in link equity per page is really going to hurt us, again. However, keeping the mixed-case URL structure is also a whammy. Building a brand new site, again, it seems like we should do it correctly and right all the previous wrongs. But on the other hand, another PR demotion and we'll be in line at the soup kitchen. What would you do?
Intermediate & Advanced SEO | | yogitrout10 -
New URL : Which is best
Which is best: www.domainname.com/category-subcategory or www.domainname.com/subcategory-category or www.domainname.com/category/subcategory or www.domain.com/subcategory/category I am going to have 12 different subcategories under the category
Intermediate & Advanced SEO | | Boodreaux0