How I Saved My Entire OpenDiary

Hey friends.
I know a lot of us are freaking out about losing years of writing, memories, and life history. I just spent hours figuring out how to download every single entry safely, and I’m sharing the steps here so you can do it too.

This guide is for regular people, not tech folks.
You don’t need to understand code. You just need to follow the steps exactly.


What You’ll Need

  • Google Chrome (recommended)

  • A computer (not a phone)

  • Your OpenDiary login

  • 10–20 minutes to start the process
    (The download runs automatically once started.)


    STEP 1 — Collect all your entry links

    1. Log in to OpenDiary.

    2. Go to your main diary page, where you see your entries listed.
      It should look like:
      https://www.opendiary.com/m/yourname/

    3. Press F12 (or Right-click → Inspect)
      A panel opens on the right or bottom.

    4. Click Console at the top.

    5. Copy the ENTIRE block below, then paste it into the console and hit Enter:

 


(() => {
async function get(page) {
const r = await fetch(`?paged=${page}`, {credentials:’include’});
const h = await r.text();
if (!h || h.length < 200) return [];
const div = document.createElement(“div”);
div.innerHTML = h;
return […div.querySelectorAll(“a”)].map(a => a.href)
.filter(u => u.includes(“/m/”) && /[0-9]+/$/.test(u));
}

(async () => {
console.log(“[collector] starting…”);
let all = new Set();
for (let p=0;;p+=5) {
const urls = await get(p);
if (!urls.length) break;
urls.forEach(u => all.add(u));
console.log(`[page ${p}] total so far: ${all.size}`);
await new Promise(r=>setTimeout(r,200));
}
const list = […all];
localStorage.setItem(‘od_urls’, JSON.stringify(list));
console.log(`[collector] stored ${list.length} URLs in your browser.`);
})();
})();


 

  1. Wait until it says something like:
    “[collector] stored #### URLs”
    (Your number will be whatever your diary has.)

✅ You’re done with Step 1.


STEP 2 — Download everything automatically

  1. While still logged into OD, open any private entry in the same tab.
    This keeps your login session active.

  2. Open the Console again (F12 → Console).

  3. Copy this ENTIRE block and paste it in:


    (() => {
    const LOGIN = (u,h) => !h || h.includes(“wp-login.php”) || h.toLowerCase().includes(“lost your password”);

    const zero = n => String(n).padStart(5,”0″);
    const slug = u => (u.split(“/”).filter(Boolean).pop()||”entry”).replace(/[^a-z0-9-._]/gi,”-“).toLowerCase();

    async function save(u,i){
    const r = await fetch(u,{credentials:”include”});
    const t = await r.text();
    if (LOGIN(r.url,t)) throw “LOGIN_REQUIRED”;
    const blob = new Blob([t],{type:”text/html;charset=utf-8″});
    const a = document.createElement(“a”);
    a.href = URL.createObjectURL(blob);
    a.download = `OpenDiary_${zero(i)}-${slug(u)}.html`;
    document.body.appendChild(a);
    a.click();
    setTimeout(()=>{URL.revokeObjectURL(a.href);a.remove();},500);
    console.log(`[saved #${i}]`);
    }

    async function run(start=0){
    const raw = localStorage.getItem(“od_urls”);
    if (!raw){ console.error(“No URL list found. Do STEP 1 first.”); return; }
    const urls = JSON.parse(raw);
    for (let i=start; i<urls.length; i++){
    try {
    await save(urls[i], i);
    } catch(e){
    if (e===”LOGIN_REQUIRED”){
    console.log(`[paused] Login expired at #${i}.`);
    console.log(`Open ANY private entry in THIS TAB, then run: odGo(${i})`);
    return;
    }
    }
    await new Promise(r=>setTimeout(r,200));
    }
    console.log(“[done] All entries saved.”);
    }

    window.odGo = run;
    console.log(“[loader ready] Type odGo(0) to start.”);
    })();


     

  4. You’ll see a message:
    “[loader ready] Type odGo(0) to start.”

  5.  
  6. Type this and press Enter:

    odGo(0)

    It will now begin downloading each of your entries one by one, automatically.

    If it pauses (this will happen sometimes)

    Sometimes OD hiccups and thinks you’re logged out.

    You’ll see:

    “Login expired at #1234. Open a private entry in THIS TAB, then run: odGo(1234)”

    Just do exactly that:

    1. Click any private entry (same tab).

    2. Reopen Console.

    3. Type:

    odGo(1234)

    It will continue where it left off.

 


Where your files go

Everything is saved to your normal Downloads folder.

Each file contains:

  • the entry text

  • the comments

  • the date

  • the title

  • the images (as embedded links)


    You’re done!

    You now have a complete offline archive of your entire OpenDiary.

    If this helps even one person save their writing, I’m glad to share it. ❤️

    If you run into trouble, comment below and I’ll help.

    Stay safe out there.

Log in to write a note