Scott Morrison has ruled out a preference deal with One Nation, toughening the Coalition’s line against the far-right nationalist party in the wake of the Christchurch terrorist attack.

The comments follow a speech by the prime minister on Monday denouncing racism and “tribalism” and urging Australians to “disagree better”, as the government aims to promote community harmony despite its own record of divisive comments regarding asylum seekers.

The blowback against racist remarks in Australian politics has so far focused on senator Fraser Anning who blamed the mosque attack on a “growing fear over an increasing Muslim presence” in Australia and New Zealand.

But with Labor hoping to revive its proposed racial code of ethics and the Greens calling for a parliamentary code of conduct, focus has shifted from Anning, who will be censured when parliament returns in April, to One Nation, the party on whose ticket the independent Queensland senator was elected.

In this term of parliament the One Nation leader Pauline Hanson has called for an end to Muslim migration and wore a burqa into the Senate to call for the Muslim garment to be banned.

On Tuesday Morrison was asked at a press conference in Adelaide if the Liberals would preference One Nation last at the federal election, as Labor plans to. “Well, there will be no preference deals with One Nation,” the prime minister replied.

The Labor senator Murray Watt accused Morrison of using “the same weasel words the [Liberal-National Party] used before the Queensland state election”.

“Fraser Anning’s comments and actions have been abhorrent and should be viewed with disdain,” he said in a statement.

Watt said the LNP had nevertheless preferenced One Nation ahead of Labor in 50 of 58 seats, electing One Nation’s Stephen Andrew in the northern seat of Mirani.

But Hanson reacted angrily to Morrison’s announcement, warning voters will punish the Liberals if they give preferences to “the economy-destroying Greens and Labor before One Nation”.

Hanson said One Nation had come “close to winning 21 seats” in the Queensland state election, but the LNP and Labor preferenced each other ahead of the minor party in “a number of seats” it otherwise might have won.

Hanson took credit for elevating the issues of water security, immigration, free trade deals and coal, discussions “we wouldn’t be having” without One Nation.

The Nationals leader, Michael McCormack, on Tuesday did not rule out preference deals with One Nation, or say where the Nationals would place the far-right party on the ticket.

“Fraser Anning’s comments and actions have been abhorrent and should be viewed with disdain,” he said in a statement.

“When it comes to preferences, as is the case with every election, the Nationals are a grass roots party and decisions are made at a state and local level.

“These decisions will be made closer to election day when all the candidates are known.”

Labor ruled out trading preferences with One Nation as far back as February 2017, when its deputy leader, Tanya Plibersek, accused the Turnbull government of going soft on right-wing populists.

In 2017 the Liberals preferenced One Nation in the Western Australian election and the then prime minister Malcolm Turnbull refused to rule out a similar deal at the federal level.

Earlier on Tuesday Labor’s leader in the Senate, Penny Wong, told ABC’s AM Morrison’s words about rejecting tribalism should be “backed up by action”.

Wong said Morrison must ensure debate in the election campaign “doesn’t involve language which is around dog-whistling and prejudice”. She called on the Coalition to follow Labor’s lead and “put right-wing extremists like Fraser Anning and Pauline Hanson last”.

“We know, as recently as the Longman byelection, Pauline Hanson’s One Nation was preferenced by the Coalition ahead of the Labor party. Now that does need to stop.”

Anning, who quit One Nation after he was chosen to replace senator Malcolm Roberts and later lost the support of Katter’s Australian Party, is unlikely to be re-elected at the federal election, expected in May.

Hanson has a six-year term and is not up for re-election in May. At the 2016 double dissolution election One Nation received 229,000 ticket votes in Queensland and Hanson received a further 21,000 personal votes, giving the party 1.19 quotas.

On those numbers, Roberts is a strong prospect to return to the Senate even without major party preferences.

Morrison’s call on Monday for Australians to “disagree better” came just hours after the home affairs minister, Peter Dutton, accused Greens politicians of being just as bad as Anning.

Scott Morrison tells the Australia-Israel Chamber Of Commerce he wants Australia to ‘reject the thinking that one person’s gain is another’s loss’. Photograph: Quinn Rooney/Getty Images

In a speech to the Australia-Israel Chamber of Commerce in Victoria, Morrison also said he wanted the nation to “reject the thinking that one person’s gain is another’s loss”.

Earlier this month, the prime minister said it was “simple math” that medically transferred asylum seekers would take the place of Australian citizen patients in hospitals.

The Liberals are currently running ads on social media that accuse Labor of wanting to “tax retirees” to pay for a 20,000 increase in the humanitarian intake of refugees.

In October government senators voted for a motion that it is “OK to be white”, only to later claim this was an “administrative error”.

Morrison himself as shadow immigration minister reportedly told shadow cabinet in 2011 the Coalition should do more to capitalise on concerns about Muslim immigration, comments he now denies.

On Tuesday Morrison took aim at social media companies, indicating he would push for their handling of hate speech and terror attacks to be placed on the agenda at the G20.

Morrison said social media platforms can be “weaponised by terrorists of any description”.

“If you can write an algorithm to make sure that the ads they want you to see can appear on your mobile phone, then I’m quite confident they can write an algorithm to screen out hate content on the social media platforms.”