In the context of writing:
* Suppress: To prevent something from being published.
* Withhold: To keep something secret or hidden.
* Conceal: To hide something from view.
* Censor: To remove or alter material considered objectionable.
* Redact: To edit or remove parts of a document, often to protect sensitive information.
In the context of software or websites:
* Withdraw: To remove something from circulation.
* Unpublish: To make something no longer accessible.
* Deactivate: To stop something from working.
In general:
* Hide: To make something invisible or unavailable.
* Conceal: To keep something secret.
* Withhold: To refuse to give something.
The best opposite for "publish" will depend on the specific situation.