Two things. Seal the border, and leave it sealed. There should be no access to Israel overland for a generation.
Secondly, it needs to be repeated, evidently, what should be clear to anyone. There will never be an independent West Bank, and there will never be an independent Gaza. It will never happen. They are not viable, either of them. They have no markets, no source of employment of their own, they are completely dependent on welfare payments from EU, UN, US, the Saudis, smuggling, terror for hire, but they have no productive capacity.
Separate from Israel, separate from Egypt and Jordan, separate from foreign welfare payments, they have no economy of their own.
They are outlaw enclaves, ruled by outlaws.
These territories have been designed to be a cancer on Israel's hide, and that has to end. Seal the border. Access to the world for the West Bank has to be via Amman. Access to the world for Gaza has to be via Egypt, or its own sea coast.
Seal them off from Israel, and they become Jordan's problem, and Egypt's. The rules of the game have to be reversed.
We, the United States, must stop sending them tens of millions of dollars in aid every year. Otherwise they have no reason to change their behavior.