How best to check if a user is from China and hide content?

I’d recommend using something like this https://www.geoplugin.com/ and write an if statement for a either a display none or noscript. If you’re looking for a good code base to start with I’d take a look at this answer. https://stackoverflow.com/a/13600004/3175165