Hasbro Inc. is sourcing more of its toys earlier from various countries as it anticipates port congestion and ocean-capacity constraints in the second half of the year, executives said.

The maker of Transformers, My Little Pony, Play-Doh and other toys is looking to get around bottlenecks in shipping operations to make sure products arrive in time for the holiday season, finance chief Deborah Thomas said on a Monday conference call. Hasbro is increasing the number of container lines it works with and using more ports to speed up delivery, she said.

“We’re also working to ensure product availability during the holiday season,” Ms. Thomas said. “We may experience some shifts in delivery dates and timing of revenue.”

The Pawtucket, R.I.-based company is among the many U.S. retailers and manufacturers that are restocking inventories as the economy reopens from Covid-19 lockdowns and more consumers head back to stores.

“We’re out to source product and to bring it in via any number of new carriers,” said Hasbro Chief Executive Brian Goldner. “The team secured more ports, and we’ve got more shipping lanes than we’ve had in the past.”

Hasbro said in April that it would raise prices to offset rising freight and input costs. Those price increases are going into effect in the third quarter, executives said. Ms. Thomas said ocean-freight prices are likely to more than quadruple this year from last year.

Other companies, faced with increased costs for materials, transportation and workers, are also charging more for products from metal fasteners to Oreo cookies, helping fuel inflation to a level the U.S. hasn’t seen in more than a decade.

Hasbro said Monday that its second-quarter revenue rose 54% to $1.32 billion. The company posted a net loss of $22.9 million, compared with a year-earlier net loss of $33.9 million.

This year’s earnings were weighed down by a charge of $101.8 million related to the sale of eOne Music assets. The toy maker had acquired the music business as part of its purchase of Entertainment One Ltd., known for the “Peppa Pig” brand, for $4 billion in 2019.

Hasbro shares closed more than 12% higher at $103.72 Monday.

Revenue more than doubled in Hasbro’s Wizards of the Coast and digital-gaming segment, which includes the brands “Magic: The Gathering” and “Dungeons & Dragons.” Revenue from the consumer-product segment, home to such brands as Nerf and the Marvel portfolio, was up 33%. Revenue for the entertainment segment, which includes shows like “Peppa Pig,” “My Little Pony” and “PJ Masks,” rose 47%.

The company expects to post double-digit revenue growth for the full year, Mr. Goldner said.

Write to Dave Sebastian at dave.sebastian@wsj.com