It is a violation of the unwritten rule book for a head coach to play favorites, but sometimes Kyle Shanahan can’t help himself.

He loves Jimmie Ward, for instance. Shanahan said he would wear Ward’s jersey on the sidelines if he could. On Wednesday, Shanahan broke into a big smile when asked about Kendrick Bourne, the third-year wide receiver with the rep for being somewhat of a goofball and a ball-dropper.

“Bourne’s a funny guy,” Shanahan said. “He reminds me a lot of my son. I don’t mean that as an insult. Kind of.”

Shanahan’s son is 9.

The fact that Bourne is still a 49er, and an important one, says something about Shanahan. He is getting a lot of praise these days for his offensive genius and his laid-back, player-friendly coaching style, but there’s more. Like a talent for seeing personal flaws and dropped passes, then looking deeper.

Exhibit A: Kendrick Bourne.

Bourne came to the 49ers two years ago as an undrafted free agent from Eastern Washington, wherever that is. Not a burner (4.6 40), didn’t seem to take anything seriously, including team meetings. He was late to a few, and finally missed one.

Shanahan snapped. He considered cutting Bourne. Some coaches would have seen that as necessary, maybe even useful. You know, deliver a message to the team. Bill Walsh occasionally cut a player in dramatic fashion to get his team’s attention.

Shanahan lit up the kid big-time, in private. He got Bourne’s attention. Then the challenge was making sure the ever-smiling youngster was locked in, focused.

Last season, Bourne ran the wrong route once. This season, against the Seahawks, he had two crucial drops. Shanahan defended Bourne that day, saying the wideout has such great hands and confidence that sometimes his concentration slips.

Shanahan indicated Wednesday that it has been a bumpy journey, from almost cutting Bourne to appreciating and understanding him, quirks and all.

“When you sit there and get on him,” Shanahan said, “he sits there and smiles at you, and at first, that used to drive me crazy, like, ‘Are you not bothered by it?’

“He is, he’s trying his hardest, he’s trying to go out there, he really loves to play football. I think you guys see how he plays. I think that (his good nature) can get taken the wrong way, in terms of (it looks like) he’s not locked into detail, and he is. He works at it all week.

“He has a lot of fun out there. Sometimes he will make mistakes, but I also think it’s a gift and a curse, it’s also why he’s never freaking out out there, either. He is loose, and the game’s not too big for him, no matter what the situation is.”

Shanahan added, “Sometimes you gotta make a point, you really want him to lock in. Sometimes you gotta make it a little bit personal, then he locks in, still with a smile.”

No coach keeps a player just because of a positive attitude and good nature, especially if that player sometimes acts the knucklehead. But there is value in an upbeat attitude.

“He keeps things light,” fullback Kyle Juszczyk said of Bourne. “This can be a very serious sport, and sometimes you can forget about the joy in it. To see him always laughing, smiling, having a good mood, it reminds you to have fun out there.”

Bourne worked through his rookie woes and started the final eight games that season, helping new quarterback Jimmie Garoppolo finish the year with a bang and earn a big new contract.

“KB, he finds the space, man,” Garoppolo said. “He’s a good, instinctive player. If the initial play isn’t there and we’re a little off-schedule, he has no problem. (He’s) working, puts his hands up, all those little things that you do when the play breaks down, he’s phenomenal at it.”

Last season, Bourne caught 42 balls for 487 yards and four touchdowns. This season, he has 27 receptions for 318 yards and five touchdowns.

He thinks Shanahan has developed trust in him.

“Yeah, I truly believe that,” Bourne said. “They (coaches) kinda can just see the difference, (I’m) more locked in. Even after the Seattle drops, I’m more focused on the ball. They just know I’m all in, man, I’m trying to get to the (Super) Bowl. I gotta do everything I can to contribute.”

Bourne has gone from struggling to make it to a meeting, to striving to make the Bowl.

Scott Ostler has been a sports columnist at the San Francisco Chronicle since 1991. He has covered five Olympics for The Chronicle, as well as one soccer World Cup and numerous World Series, Super Bowls and NBA Finals.

Though he started in sports and is there now, Scott took a couple of side trips into the real world for The Chronicle. For three years he wrote a daily around-town column, and for one year, while still in sports, he wrote a weekly humorous commentary column.

He has authored several books and written for many national publications. Scott has been voted California Sportswriter of the Year 13 times, including six times while at The Chronicle. He moved to the Bay Area from Southern California, where he worked for the Los Angeles Times, the National Sports Daily and the Long Beach Press-Telegram.