![]() |
| Figure 1. Google Photos "Book & Magazine Covers" and "Posters" albums. |
![]() |
| Image generated by Grok. |
The last time Google broke all of the existing links to my "Book & Magazine Covers" and "Posters" albums, I manually edited all of my blog posts and put in the new replacement URLs page by page. This time, I ended up editing my blog's Theme file so as to make a table of URL re-directs. Below is the discussion that I had with Google's AI in which I learned how to edit the Blogger Theme file.
CHATBOT HELP SESSION:
Me: Why is Google unable to maintain stable links to user content?
Google AI: Google's perceived inability to maintain "stable" links for user content often stems from security protocols, API lifecycle changes, and the fundamental design of how their cloud services generate shareable vs. direct URLs.
While a document's main "Share" link remains constant as long as the file exists, other types of links—especially direct image URLs or hosting links—are intentionally temporary for the following reasons:
1. Security and Expiring Access
![]() |
| Image generated by Grok. |
lh3.googleusercontent.com) are frequently
designed to be short-lived.
- Token Expiration: These deep links often contain security tokens that expire after a set time (e.g., 60 minutes for API-retrieved items) to prevent unauthorized "hotlinking" and protect user privacy.
- Permissions Changes: If a user changes a file's visibility from "Public" back to "Restricted," Google immediately invalidates any previously active shareable links to ensure privacy.
Google has historically retired entire link formats as its infrastructure evolves:
- Deprecated Hosting:
Google Drive's web hosting feature was officially shut down,
breaking millions of links that used the
googledrive.com/host/format. - Security Updates: In 2021, Google applied a "Security Update" to Drive that added a resource key to many shared links. Old links without this key became broken for users who hadn't previously accessed the file, requiring the generation of new URLs.
![]() |
| Image generated by Grok. |
- New Uploads: If you delete a file and re-upload the same one, Google treats it as a brand-new entity with a different ID and a different link. To maintain a stable link while updating content, you must use the Manage Versions feature instead of re-uploading.
Would you like instructions on how to create a permanent "Direct Download" link for a Google Drive file that bypasses the viewer?
Me: I now have hundreds of dead links on my Blogger blog pages due to Google's inability to maintain stable URLs. Is there a tool for doing mass updates of broken URLs across multiple blog posts?
Google AI: Blogger does not have a built-in "find and replace" tool for post content, but you can achieve mass updates by manipulating your blog's backup file.
1. The Export-Edit-Import Method (Most Reliable)
![]() |
| Image generated by Grok. |
- Backup/Export: Go to Settings > Manage Blog > Back up content and download the XML file.
- Edit Locally: Open the XML file in a powerful code editor like Notepad++, Sublime Text, or VS Code.
- Bulk Find & Replace:
Use
Ctrl+Hto find the old base URL (e.g., the dead Google Photos or Drive prefix) and replace it with the new one.- Tip: If you are replacing many unique URLs, you can use "Regular Expressions" (Regex) in these editors to target specific patterns.
- Import: Go back
to Settings > Manage Blog >
Import content.
- Warning: To avoid creating duplicate posts, ensure you import the edited file back into the same blog. However, some users report that re-importing can occasionally change post permalinks, so test this with a single post or a test blog first.
![]() |
| Image generated by Grok. |
- Broken Link Check: A free online tool that scans your entire site and shows you the exact HTML "Src" (source) for every dead link.
- Screaming Frog SEO Spider: A desktop application (free for up to 500 URLs) that can crawl your site and bulk-export a list of all 404 errors to CSV.
- Dead Link Checker: Offers a "Multi-Check" feature that emails you a consolidated report of broken links across multiple pages.
There is a shortcut for the Blogger editor itself, though its effectiveness across all historical posts can vary:
Ctrl+Shift+R: In some versions of the Blogger post editor/dashboard, this shortcut triggers a "Find and Replace" dialogue for code or text.
|
Step |
|---|
|
Action |
Tool Recommendation |
|
|---|---|---|
|
Audit |
Find every dead link and its location |
BrokenLinkCheck.com |
|
Export |
Download blog data |
Blogger Settings > Back up content |
|
Update |
Mass replace URLs in the XML file |
Notepad++ or VS Code |
|
Restore |
Upload the fixed XML |
Blogger Settings > Import content |
![]() |
| Image generated by Grok. |
Me: It seems like it would be trivial for Google to put into Blogger a feature that allows for users to create and maintain a short list of known broken URLs on their blog pages and their redirects to functioning URLs.
Google AI: While it would be highly practical, Google Blogger currently restricts its
Custom Redirects feature to internal URL management. It does not offer a global "link-remapping" database for external content.
Limitations of Current Tools
- Internal Scope Only:
The Blogger Custom Redirects tool only allows you to map a path
within your blog (e.g.,
/old-post.html) to another path within your blog. It cannot intercept a request for an external link like://photos.google.comand redirect it to a new location. - Manual Entry: Even for internal links, each redirect must be added one by one. There is no native bulk-upload feature for this list.
- Hardcoded Links: When you publish a post, the HTML contains the static URL. Browsers follow that URL directly; they do not check a Blogger-hosted "redirect list" unless the link first points back to your own domain.
Why This Feature Doesn't Exist
![]() |
| Image generated by Grok. |
- Add latency to every click for your readers.
- Potentially hurt your SEO, as search engines prefer direct links to authoritative content.
Current "Best" Workarounds
If you frequently use links that you expect to break, the most stable long-term strategy is to use a URL Shortener with "Edit" capabilities:
- Use a Service: Create links through a tool like BetterLinks or Sniply.
- Point to the Source: Use the shortened link in your Blogger post.
- Update Once: When the source URL changes, you update it in the shortener's dashboard once, and every blog post using that short link is instantly fixed.
Google AI: While Blogger doesn't offer a built-in table for external link remapping, you can effectively build your own using a custom
JavaScript snippet in your blog's theme. This allows you to maintain a "mapping table" that automatically redirects broken URLs to functional ones whenever a reader clicks them.
How to Implement Your Own URL Mapping Table
![]() |
| Image generated by Grok. |
- Go to Theme Settings: In your Blogger Dashboard, go to Theme > click the arrow next to "Customize" > Edit HTML.
- Insert the Mapping Script: Find the
</body>tag (usually at the very bottom) and paste the following script right above it:
<script type='text/javascript'>
// YOUR CUSTOM MAPPING TABLE
const urlMap = {
"https://old-google-link-1.com": "https://new-functional-link.com",
"https://old-google-link-2.com": "https://new-storage-service.com",
"https://broken-link-3.com": "https://fixed-link-3.com"
};
document.addEventListener('click', function(e) {
let element = e.target.closest('a');
if (element && urlMap[element.href]) {
e.preventDefault(); // Stop the browser from going to the dead link
window.location.href = urlMap[element.href]; // Redirect to your functional link
}
}, true);
</script>Use code with caution.
![]() |
| Image generated by Grok. |
- Centralized Control: You only have to update this single script in your theme to fix every instance of a broken link across all your hundreds of posts.
- No "URL Shortener" Needed: The script runs in the user's browser. It checks the link at the exact moment they click it; if it's on your "broken list," it instantly swaps the destination for the functional one.
- Mass Replacement: You can even use more advanced scripts to automatically scan your page and replace all matching URLs in the HTML as soon as the page loads, so the user never even sees the dead link in their status bar.
Limitations to Consider
- Maintenance: You
still have to manually populate the
urlMaptable with your known dead/new links. - SEO: While this fixes the experience for human readers, search engine crawlers often don't execute JavaScript. To search engines, the links will still appear broken unless you use the Blogger XML export method to permanently replace them in the post content.
Me: This is an old URL that used to allow people to access my Photo Album {https://photos.google.com/b/107059216299718970166/share/AF1QipNjb8t3gofnVKgIzGfgyC5LtXC-z0gveQrrFf55ScOFUiSgyFIkSXtK8ajDwjd4ig?key=cEFYMzRpVnhRZEZNa2J5WnZOT2x1RzdOWklLRWRR} And this is the new URL format {https://photos.app.goo.gl/Tkja717BmFLLyrEm6}
![]() |
| Image generated by Grok. |
However, you can use the JavaScript Mapping Table method to fix these links across your blog instantly.
The Solution: Instant Redirect Script
You can add this script to your Blogger theme. It will watch for clicks on any of your old, dead Google Photos links and silently redirect the user to the correct new album.
In Blogger, go to Theme > click the arrow next to "Customize" > Edit HTML.
Scroll to the very bottom and paste this right before the
</body>tag:
<script type='text/javascript'>
// YOUR REDIRECT TABLE
const photoRedirects = {
// Copy exactly the old URL inside the quotes, then the new one
"https://photos.google.com/b/107059216299718970166/share/AF1QipNjb8t3gofnVKgIzGfgyC5LtXC-z0gveQrrFf55ScOFUiSgyFIkSXtK8ajDwjd4ig?key=cEFYMzRpVnhRZEZNa2J5WnZOT2x1RzdOWklLRWRR":
"https://photos.app.goo.gl/Tkja717BmFLLyrEm6",
// Add more pairs here as you find them, separated by commas
"OLD_URL_2": "NEW_URL_2"
};
document.addEventListener('click', function(e) {
let link = e.target.closest('a');
if (link && photoRedirects[link.href]) {
e.preventDefault(); // Stop the dead link from loading
window.location.href = photoRedirects[link.href]; // Go to the new one
}
}, true);
</script>
![]() |
| Image generated by Grok. |
Why this is your best option:
Zero Link Rot: Even though the link in your post is "dead," it will work perfectly for your readers because the script swaps it out at the moment of the click.
Centralized: If Google changes the format again in five years, you only have to update this one table in your theme settings, rather than editing hundreds of individual blog posts.
Legacy Issues: Google has historically deprecated various link formats (like the
b/prefix you see in your old URL), and they have recently announced that even some "goo.gl" short links may stop working unless they are "actively used". This script protects you from future changes.
Do you have a list of these old and new URL pairs ready, or would you like a tool to help you crawl your blog and find all the dead ones at once?
Me: I don't see </body> near the end of bu Blogger blog's Theme file. These are the last 5 lines of code in the file: <b:include name='quickedit'/> </b:includable> </b:widget> </b:section-contents><b:section-contents id='footer-1'/><b:section-contents id='footer-2-1'/><b:section-contents id='footer-2-2'/></html>
![]() |
| Image generated by Grok. |
</body> tag is
missing because Blogger's modern XML themes often
use compressed or "folded" code. To find the correct spot
for your redirect table, do not scroll manually; use the editor's
built-in search tool.
1. Locate the Hidden Tag
In the Blogger HTML Editor, click anywhere inside the code area.
Press Ctrl + F (or Cmd + F on Mac) to open the editor's internal search bar (do not use your browser's search).
Type
<body(without the closing bracket) and hit Enter.If it still looks like your snippet, click the black arrow next to the line numbers to "expand" the code. The
</body>tag is often hidden within these collapsed sections near the end.
2. If the Tag is Truly Missing
![]() |
| Image generated by Grok. |
</body>, you can place the
script directly before the </html> tag you see on
your last line. However, the most "Blogger-friendly" way to
add this without breaking your theme's XML structure is to use the
Layout tab instead.
Go to Layout in the left menu.
Scroll to the very bottom and click Add a Gadget in the "Footer" or "Sidebar" section.
Select HTML/JavaScript.
Leave the Title blank and paste your script into the Content box:
<script type='text/javascript'>
const photoRedirects = {
"https://photos.google.com":
"https://photos.app.goo.gl"
};
document.addEventListener('click', function(e) {
let link = e.target.closest('a');
if (link && photoRedirects[link.href]) {
e.preventDefault();
window.location.href = photoRedirects[link.href];
}
}, true);
</script>Use code with caution.
Click Save and then click the Save icon (floppy disk) at the bottom right of the Layout page.
![]() |
| Image generated by Grok. |
Would you like me to show you how to expand the script so it also automatically updates the "src" of images that might be broken, or just the clickable links?
Me: line 1911 has the </body> tag. Lines 1900 to 1911 are: <div class='cap-left'/> <div class='cap-right'/> </div> </div> </div> <script type='text/javascript'> window.setTimeout(function() { document.body.className = document.body.className.replace('loading', ''); }, 10); </script> </body>
Google AI: Perfect. Since you already have a
<script> block
there, you can tuck your mapping table right inside it. This keeps
your code clean and ensures it runs as the page finishes loading.
Updated Implementation
Replace lines 1906 to 1910 with the following code. I’ve merged your redirect logic with the existing "loading" class removal script:
![]() |
| Image generated by Grok. |
<script type='text/javascript'>
window.setTimeout(function() {
document.body.className = document.body.className.replace('loading', '');
}, 10);
// YOUR URL REDIRECT TABLE
const photoRedirects = {
"https://photos.google.com":
"https://photos.app.goo.gl"
};
document.addEventListener('click', function(e) {
let link = e.target.closest('a');
if (link && photoRedirects[link.href]) {
e.preventDefault();
window.location.href = photoRedirects[link.href];
}
}, true);
</script>Use code with caution.
A Pro-Tip for Maintenance
As you find more dead links, just add a comma after the last URL pair and add the new one.
Format:
"OLD_URL": "NEW_URL",Case Sensitivity: Make sure the "OLD_URL" exactly matches what appears in your browser's address bar (or the status bar) when you hover over the broken link on your blog.
Why this is better than the XML export method:
![]() |
| Image generated by Grok. |
Do you have a batch of other URLs you need to add to this list right now, or should we verify if this first one works on your live site?
Me: I got this message:
org.xml.sax.SAXParseException; lineNumber: 1919; columnNumber: 17; The entity name must immediately follow the '&' in the entity reference.
Google AI: The error
org.xml.sax.SAXParseException
occurs because Blogger treats your theme file as an XML
document. In XML, the ampersand (&) is a
reserved character that starts an "entity". Because your
old Google Photos URL contains ?key=..., the XML parser
is looking for an entity name like & but finds
the "k" in "key" instead.
To fix this, you must wrap your JavaScript code in a CDATA section. This tells Blogger's parser to ignore everything inside that block and treat it as raw text, rather than XML code.
The Fixed Code
![]() |
| Image generated by Grok. |
<script type='text/javascript'>
//<![CDATA[
window.setTimeout(function() {
document.body.className = document.body.className.replace('loading', '');
}, 10);
// YOUR URL REDIRECT TABLE
const photoRedirects = {
"https://photos.google.com":
"https://photos.app.goo.gl"
};
document.addEventListener('click', function(e) {
let link = e.target.closest('a');
if (link && photoRedirects[link.href]) {
e.preventDefault();
window.location.href = photoRedirects[link.href];
}
}, true);
//]]>
</script>Use code with caution.
Why this works:
//<![CDATA[: This marks the start of the "Character Data" section.//]]>: This marks the end of the section.The
//(JavaScript comments) prevent the browser from trying to execute the CDATA tags as actual code, while the XML parser uses them to safely skip over your ampersands.
![]() |
| Image generated by Grok. |
Would you like me to add a line to this script that automatically highlights these "remapped" links in a different color so you can easily spot them on your blog?
Me: That worked. Thank you.
Google AI: Sweet success! I'm glad that worked. Dealing with
XML parsers is always a bit of a headache when you just want to paste a URL.
Now that the system is live, you can
keep adding to that photoRedirects list as you find more
broken links. Just remember to add a comma after
each closing quote (except the very last one) to keep the JavaScript
happy.
![]() |
| Image generated by Grok. |
Would you like to see how to verify which of your blog posts still contain these old dead links so you can add them to your table?
___
I saved my original
Blogger Theme file for wikifiction.com.
The following new
code...
<script type='text/javascript'>//<![CDATA[window.setTimeout(function() {document.body.className = document.body.className.replace('loading', '');}, 10);// YOUR URL REDIRECT TABLEconst photoRedirects ={
"https://photos.google.com/b/107059216299718970166/share/AF1QipNjb8t3gofnVKgIzGfgyC5LtXC-z0gveQrrFf55ScOFUiSgyFIkSXtK8ajDwjd4ig?key=cEFYMzRpVnhRZEZNa2J5WnZOT2x1RzdOWklLRWRR":
"https://photos.app.goo.gl/Tkja717BmFLLyrEm6",
"https://photos.google.com/b/107059216299718970166/share/AF1QipN6bOFeiYsOYoRt0tU9oW_0hs_QMDAaOQpDn2fwrxu-0wpqb6ToY7m3ep_2peNwCQ?key=Q3BpazRrWmZ1aXpxNVF4NzlOX3M3NFk3ZVIzMnln":
"https://photos.app.goo.gl/3sBFuqxXyZkyEktN9"
};
document.addEventListener('click', function(e) {let link = e.target.closest('a');if (link && photoRedirects[link.href]) {e.preventDefault();window.location.href = photoRedirects[link.href];}}, true);//]]></script>
replaced the following original code in my Theme file:
<script type='text/javascript'>
window.setTimeout(function() {
document.body.className = document.body.className.replace('loading', '');
}, 10);
</script>
Next: plans for Chapter 8 of "The Sims".
![]() |
| Images generated by Grok. Visit the Gallery of Movies, Book and Magazine Covers |






















No comments:
Post a Comment