Google Image Search


#1

Hi there, I’m thinking of migrating my 3d printing blog https://3drucken.ch from wp to ghost(pro). One concern I got is the Google image search. Because some of my images uploaded to wp are quite popular in Google image search, I’d like to keep them in their search ranking. Is there a way to map the old image URLs so they will still appear in the search results where they are now? Thanks for any help!


#2

Yes, you can redirect your old URL’s to the new ones (which are pretty similar, located in /content/images/2018/12/image.jpg) with Ghost’s redirect functionality.

The redirects.json file should contain something like this (I think, not 100% sure, I am bad with regex):

{
  "from": "/wp-content/uploads/\/([0-9]{4})\/([0-9]{2})\/([a-z0-9-]+)(.jpg)?(\/)?$" ,
  "to":  "/content/images/$1/$2/$3",
  "permanent": true
}

More info here:


#3

Thank you very much for your fast and helpful reply! I’ll try this once I imported the json and uploaded all the images.


#4

Also, if you’re migrating to GhostPro, get in touch with the Ghost team at support@ghost.org. They will give you a hand with the migration so that all goes smoothly.


#5

I was not able to do a redirect regex that matches dots . in filenames of the images I used on Wordpress. Any ideas how to match image names with multiple dots in them?


#6

In the end, I used this simple rule:

{
  "from": "^/wp-content/uploads/(.*)$",
  "to":  "/content/images/$1",
  "permanent": true
}

#7

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.