# Template corruption in Anki 2.1.47

**URL:** <https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335>\
**Category:** Help\
**Created:** [September 14, 2021, 9:16pm UTC](https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335 "2021-09-14T21:16:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljredux](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/ljredux/32/34605_2.png) [@ljredux](https://forums.ankiweb.net/u/ljredux)\
**Post date:** [September 14, 2021, 9:16pm UTC](https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335/1 "2021-09-14T21:16:31Z")

</div>

I was editing the CSS of a **Basic (and reversed card)** deck today.

My process was:

1. Edit CSS code in the Styling editor.
2. Click Save button after a sizeable edit.
3. Occasionally check the card using the Preview button.
4. Goto 1.

After about an hour, something weird happened, the HTML code in the front and back editors for Card 1 copied over to (ie. replaced) the front and back code for Card 2. I only realised because the preview was showing the question side of each card in the same language.

But I did not do any editing in the HTML template editors. Only the CSS (Styling) editor.

I retrieved my original HTML code from a backup, and that fixed the problem.

I’m trying to understand what happened because I’m convinced it wasn’t due to user error. I was not editing the HTML at all and copy/pasting code from _both_ front and back of one card to the other is not exactly an easy mistake to make.

Thanks.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 15, 2021, 9:35am UTC](https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335/2 "2021-09-15T09:35:13Z")

</div>

Did you rule out add-ons? [When problems occur - Frequently Asked Questions](https://faqs.ankiweb.net/when-problems-occur.html)

---

<div class="post-metadata">

**Author:** ![ljredux](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/ljredux/32/34605_2.png) [@ljredux](https://forums.ankiweb.net/u/ljredux)\
**Post date:** [September 15, 2021, 10:01am UTC](https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335/3 "2021-09-15T10:01:28Z")

</div>

I try to avoid add-ons. The only ones I use are _Review Heatmap_ and _HTML Window source_ and they have been installed for a couple of years. During that time I have extensively edited the HTML and CSS without issues.

I think only _Review Heatmap_ writes to the database, but I’ve never heard of it causing an issue like this before. _HTML Window source_ doesn’t seem to hook into the Cards editor.

I spent another hour editing the CSS this morning without problems, so whatever caused this problem - I suspect it’s going to be difficult to replicate.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 15, 2021, 11:18am UTC](https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335/4 "2021-09-15T11:18:44Z")

</div>

I can’t think of a reason why that would happen, and recent Anki versions should actually refuse to save notetypes with duplicate templates. If you are able to reproduce it again in the future and spot a pattern, please let us know.

---

<div class="post-metadata">

**Author:** ![ljredux](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/ljredux/32/34605_2.png) [@ljredux](https://forums.ankiweb.net/u/ljredux)\
**Post date:** [September 15, 2021, 5:27pm UTC](https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335/5 "2021-09-15T17:27:40Z")

</div>

Thanks for replying. Your feedback is very reassuring. I’ll definitely let you know if it happens again.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 4:50am UTC](https://forums.ankiweb.net/t/template-corruption-in-anki-2-1-47/13335/6 "2023-05-01T04:50:46Z")

</div>

Closed on May 1, 2023, 4:50am UTC


