Avril wrote this song with the Swedish songwriter/producers Max Martin and Shellback. It is one of several tracks on Goodbye Lullaby in which Lavigne shows her vulnerable side. She said in publicity materials: "I allowed myself to be vulnerable. I think it's during the real moments that people can relate the most. Those who have heard the album have had very strong emotional reactions to the songs, so I realized that when something is so real, it will probably touch somebody. The beauty of music is that it's open to interpretation."
This was the first time Lavigne had worked with Max Martin, but it seems the pair forged quite a bond. She told MTV News: "It's kind of hard to work with someone new, and when I went in and did vocals on 'Wish You Were Here,' I did my first take, and then Max stood up and was like, 'I'm so honored that you're here.' And it was a really special moment, where he understood me and I understood him. We connected and had a really great time. And it was really magic my first trip there. He's sweet."
Avril explained that this is a song that talks about, "Missing somebody for a day, for a week, for a month. Somebody you've had a falling out with, there's so many different circumstances in life that we all go through when we do truly miss somebody."
The song's stripped down raw video was directed by Marc Webb and finds Lavigne mourning the absence of her former lover. She tweeted after filming the clip: "The tears are real ... no onions!"
Lavigne was asked by AOL Music if this song is about her former husband, Sum 41 frontman Deryck Whibley, who she filed for divorce from in October 2009? She replied: "People will always make their assumptions. I never really get into exact detail about what my songs are about. I put them out there and hope they inspire people. The message with 'Wish You Were Here' is looking back and remembering all the good times and missing somebody. And we all go through missing someone at some point in our lives, whether it's someone we've separated from or had a falling out with."