|“||My dear boy, do use your common sense! My books wouldn't have sold half as well if people didn't think I'd done those things... Now you mention it. I'm rather gifted with Memory Charms. Otherwise, all those wizards would have gone blabbing. I'd never have sold another book. In fact, I'm going to have to do the same to you.||„|
|~ Gilderoy Lockhart revealing his true colors.|
|“||So, you first mr.Potter. Say goodbye to your memories. Obliviate!||„|
|~ Lockhart attempting to put a Memory Charm on Harry Potter, but the spell backfires at him|
Gilderoy Lockhart is a temporary Defense Against the Dark Arts teacher at Hogwarts and serves as the hidden quaternary antagonist of J.K. Rowling's Harry Potter and the Chamber of Secrets and its film adaptation. He is potrayed by Kenneth Branagh, who also portrays Viktor Cherevin and Dr. Arliss Loveless and also plays Dr. Frankenstein in the film version of the novel.
Lockhart was born to a Muggle man and a witch and had two elder Squib sisters. He was spoiled by his mother in his childhood. When he obtained his Hogwarts acceptance letter, his mother was so excited that she forgot Hogwarts was merely an ordinary wizard school.
At Hogwarts, Lockhart was a brilliant and clever Ravenclaw student who had exceedingly high hopes for himself. He studied for glory and achieved infamy among the Hogwarts staff and students with antics like sending himself 800 valentines and carving his name into the Quidditch pitch.
After his graduation, he became a bestselling author. Having mastered Memory Charms, he tracked down accomplished wizards, tricked them into revealing their greatest deeds, and took the credit for said deeds while erasing their memories. He became famous by writing books about his "exploits," gaining awards and invitations for book signings.
While his former teachers began to think they had misjudged him, Headmaster Albus Dumbledore suspected Lockhart's fraudulence. In 1992, Dumbledore approached Lockhart for a position as Defense Against the Dark Arts professor, deducing that doing so would expose Lockhart. To get into Lockhart's graces, Dumbledore hinted that Lockhart would have the famous Harry Potter as a student, and Lockhart accepted the position.
Harry Potter and the Chamber of Secrets
In his new position, Lockhart once again became infamous among staff and students. He began the school year by issuing a quiz focusing on his books, then unleashing Cornish pixies and poorly subduing them. Afterwards, he spent the rest of the year reading excerpts from his books. He also hounded Harry Potter with acts ranging from poorly healing Harry's broken arm, requesting that Harry answer Lockhart's fan mails, having Harry re-enact scenes from Lockhart's books, founding a short-lived Dueling Club, and setting up a bombastic Valentine's Day event.
After Ginny Weasley was taken into the Chamber of Secrets, Lockhart planned to leave Hogwarts instead of rescuing her, revealing himself to be a coward. When Harry and Ron forced him to help them find her, he confessed his fraudulence. Inside the Chamber of Secrets, Lockhart seized Ron's broken wand and attempted to use a Memory Charm to erase their memories, but the spell backfired, erasing his own memories. He was then taken into St. Mungo's Hospital for Magical Maladies and Injuries, much to the staff and students' joy.
Harry Potter and the Order of the Phoenix
3 years later, Lockhart was still in St. Mungo's, residing in the Permanent Resident Ward. He had recovered to the point of being able to write letters, though he still had no idea how he had ended up there. While Ron felt guilty about putting Lockhart in this situation, Harry wasn't, since Lockhart was at fault for erasing his own memories when he was trying to erase theirs.
- Originally, in the earlier drafts of Harry Potter and the Order of the Phoenix film, Lockhart would have reappeared like in the book, with Kenneth Branagh reprising his role. He was ultimately cut from the movie.