New X users with interests in topics such as crafts, sports and cooking are being blanketed with political content and fed a steady diet of posts that lean toward Donald Trump and that sow doubt about the integrity of the Nov. 5 election, a Wall Street Journal analysis found.

The Journal created accounts on the social-media platform that only signaled an affinity for nonpolitical subjects, but a majority of the posts in their For You feed were partisan or related to the election. Kamala Harris ’s campaign topped the list of most-seen accounts, with one post mocking pro-Trump hecklers at her rally in Wisconsin reaching all the Journal’s accounts. Ten of the other top 14 most-seen leaned right, including Trump’s, and overall, pro-Trump content appeared about twice as frequently as pro-Harris material.

“If that cringe, dingbat, zero-votes, airhead Kamala Harris is able to cheat enough to win the presidency—the USA is over,” wrote catturd2 in a post served to nearly all of the Journal’s newly created accounts.

X has faced tumult since Elon Musk ’s 2022 takeover but remains a place where tens of millions of Americans congregate and take in information. What users see has implications for the platform’s business, which has struggled with many big advertisers nervous about controversial content . X has said that politics accounts for only a small percentage of what users see, but the Journal’s analysis found that, at least for new users, political content is hard to escape.

A spokesman for X declined to respond to a detailed list of questions sent by the Journal.

To gauge X’s role in recommending posts related to politics and the election, the Journal established its accounts with apolitical interests across five states, four of which are battlegrounds. The accounts signed on at regular intervals and scrolled through the platform’s For You timeline, an algorithmic feed. The Journal used a computer program to automatically categorize if and how the posts were political.

Fewer than a third of unique posts seen by the Journal’s accounts were political in nature. But X’s algorithm reupped political posts so often that they accounted for about half of the total posts on the accounts’ For You feeds.

Musk, who has endorsed and financially backed Trump for president, says that the company’s handling of content is separate from his personal views.

“The platform is neutral, but I will voice whatever opinions I have,” he posted in June.

The Journal couldn’t determine why X recommended any particular piece of content. The company has released code that it says powers its recommendation system. “The algorithm is open source and just tries to show people what they’re most likely to find engaging,” Musk posted in August . Yet researchers say X hasn’t shared other information needed to get a complete picture.

The Journal account interested in crafts, theme parks and running received the most political content, while the account interested in science, music and travel saw the least.

Several factors might be amplifying political content on X, including users’ behavior, according to former X engineers. The platform’s policies under Musk dismayed many liberal users. It reinstated an estimated thousands of accounts that were suspended for violating policies under Twitter’s previous management, and included many right-wing users and Trump’s own account, @realdonaldtrump, which then-Twitter took down following the Jan. 6, 2021, attack on the U.S. Capitol.

Republicans are largely the biggest political advertisers on X, according to company data, although the Journal’s analysis excluded posts labeled as ads. All told, the Journal’s accounts saw more than 26,000 unique posts.

While the Journal’s analysis found X served right-leaning content more often, the Harris campaign’s No. 1 spot shows her campaign’s strategy of embracing virality and memes to reach a broader audience could be paying off.

The platform often suggested Musk, who has the most followers of any user on X, should be a new user’s first account to follow. His posts also appeared at the top of the Journal accounts’ For You feeds more than any other user, including a video clip posted Oct. 17 of him campaigning alongside Trump, served first to each of the Journal’s accounts.

By the following Monday, Musk’s rally video was second only to a post from Alex Jones, the once-banned conspiracy theorist , who predicted a landslide for Trump. “But The Desperate Deep State Is Planning Multiple October Surprises & Black Swan Events!” said Jones’s post , viewed more than 30 million times as of Oct. 24.

Musk oversees six companies, including the electric-vehicle maker Tesla and the rocket company SpaceX. He runs engineering at X, and former employees say changes to the platform happen at his whim. When Musk has an idea or a complaint, he has a habit of texting top engineers to have it addressed.

At one point last year, engineers boosted Musk’s posts after he complained they weren’t receiving as much attention as warranted, the Journal previously reported . More recently, Musk complained that a fraction of users saw his livestreams. Engineers then worked on giving livestreams more promotion generally on the site, according to a person familiar with the effort.

Before Musk acquired Twitter in late 2022, findings from its own research suggested the platform was primed to amplify voices on the political right. Researchers couldn’t determine why, and that research department was dismantled in the midst of sweeping job cuts shortly after Musk’s takeover, former employees said.

Republicans now see X more favorably, with 53% of right-leaning users telling a Pew survey this year that X was mostly good for democracy—up from 17% in 2021. Left-leaning users slightly outnumbered right-leaning ones on the platform last year, Pew found , 26% to 20%.

Write to Jack Gillum at jack.gillum@wsj.com , Alexa Corse at alexa.corse@wsj.com and Adrienne Tong at adrienne.tong@wsj.com