Since I have not migrated the images, all of these anchor tags link to non-existing sources. Thus, they throw a 404 error.
Therefore, I need to get rid of all existing anchor tags linking to the old folder structure. To do so, I have used the following regex expression:
<a href="/content/images/wordpress"(.*?)</a>
After re-uploading the edited mobile-doc file I first considered my mission as successful since all the images had been removed from the content. So far, so good.
After running a crawl with ahref I had to realize that for all of the existing articles new permalinks/slugs had been created with the following scheme:
__GHOST_URL__ is replaced with your configured site URL when rendering, it means that changing your URL (even changing subdirectory) is possible without having to touch your content at all.
It’s not clear from your description what replacement you actually performed. Can you provide a before, after-expected, and after-actual? How did you perform the change, via the API or directly in the database?
thanks for the reply. Okay, let’s get more concrete of the changes I have performed.
My goal was so automatically remove all anchor-tags linking to a non-existing wordpress image. Thus, I removed via regex all a-tags containing the path /content/images/wordpress or /wp-content/uploads.
All actions have performed in the .json-file containing the content of my blog.
And now, we’re coming back to the ahrefs report. After I have deleted all the anchor tags with the broken images, Ghost somehow adds the path to my site logo to all existing permalink.
How does the data look in the database after you’ve imported - both the mobiledoc and rendered html fields? And what is the HTML output when viewed on your site?
The rendered result looks fine too. Since I have not deleted the surrounding <p> tag neither the <em> tag we can still see a subtitle. However, this is fine.