How can I prevent players from placing blocks on an unmodded server?

Solution 1:

Put the player in Adventure Mode with the command /gamemode <playername> a

Solution 2:

My answer in the linked question is a viable solution for this as well.

Modify the following variable in the server.properties file:

spawn-protection=999999

Then OP yourself and anyone else you trust to place and destroy blocks. There must be at least one OP for spawn-protection to work.

Solution 3:

The answer is simple: if you do /gamemode adventure @a, than none of the players can place or break blocks.

I hope this helped you