The aftermath of a failed relationship: Rory McIlroy walks 18 holes; Caroline Wozniacki runs 26.2 miles.

Wozniacki, the world’s 13th-ranked female tennis player, was supposed to marry the golfer Rory McIlroy in November. But McIlroy broke off the engagement in May, days after invitations were sent out. Wozniacki’s Plan B: to run the New York City Marathon on Nov. 2.

Wozniacki, a native of Denmark who once spent more than a year atop the women’s rankings, will be in the New York field along with Meb Keflezighi, who won the Boston Marathon in April.

Wozniacki said she had contacted New York Road Runners to enter not because of heartbreak, but because competing in the marathon was a personal goal and she wanted to raise money for a charity.