content: 
  ===Writing===
  The episode was written by series co-creators David Benioff and D. B. Weiss.
  "Beyond the Wall" was written by the series' creators David Benioff and D. B. Weiss. In the "Inside the Episode" featurette published by HBO following the airing of the episode, David Benioff indicated that the death of the dragon Viserion was something that he and the writers had been working towards for a long time, and added "The whole path of the show in some way has been trying to map out all of the episode end points, and with this one, it was the dragon opening its blue eye, and realizing that the Night King has finally gotten his own weapon of mass destruction." Weiss also stated that the most enjoyable part in writing the sequence was to make it seem as though all of the "good guys" were going to "get out the other side more or less scot-free," and knew that subsequently killing the dragon would have "a tremendous emotional impact," due to its importance to Daenerys. He continued by saying that they knew it would be important for the Night King to seize on the opportunity to kill a dragon, and that they intended for the scene to be a "one-two punch" by having the viewer witness "the horror" involved with seeing "one of these three amazing beings like this in the world going under the water and not coming up again, and processing that," but also "processing something that's even worse," by having the dragon pulled out of the water and becoming a part of the Night King's army.
  Regarding the inclusion of the wight polar bear attack, Benioff and Weiss stated that they had wanted to have a wight polar bear for "about four seasons," but never made it onto the screen due to opposition from the special effects team. Weiss recalled being told that they were not able to afford the special effect, but felt that it made "perfect sense that you could have one of these things out there, and we really put our four feet down and said goddamnit, we want a zombie polar bear," and thus wrote it into the episode.
  Weiss also spoke about the concluding Winterfell sequence, saying that once Sansa finds Arya's collection of faces and is confronted, Sansa was intended to start to see Arya as "a real, physical danger to her," and that they wanted to translate that fear to the subsequent episode, in "The Dragon and the Wolf".