content: 
  ===Writing===
  The episode was written by the showrunners David Benioff and D. B. Weiss, based on the original book by George R. R. Martin.
  The title of the episode refers to the Great Sept of Baelor, the main religious building in King's Landing, where the episode's pivotal scene takes place. In the world created by George R. R. Martin, Baelor I Targaryen was a king during a previous century, revered as a patron and supporter of the Faith of the Seven. "Baelor" includes the content of the book's chapters Eddard XV, Catelyn IX, Jon VIII, Tyrion VIII, Catelyn X, Daenerys VIII and Arya V (59–61 and 63–66).
  The scene with the drinking game between Tyrion, Bronn and Shae was written specifically for the episode, but the story of Tyrion's ill-fated marriage to Tysha was taken from a previous chapter of the books. Shae's background was changed from Westerosi to foreign to accommodate Kekilli's accent. Other notable divergence from the books include the modification of the whole strategy of Robb Stark when dividing his forces, and a change to the Targaryen genealogy as explained by Maester Aemon: in the TV adaptation the Mad King is described as the son, rather than the grandson, of Aegon V (thus eliminating Jaehaerys II from the succession of kings).