Avoid rendering hidden objects (blender 2.8)
In the Outliner you can toggle visibility and renderability of objects.
Click on the funnel icon on the top right and enable different filters.
The Eye icon determines visibility in the 3d viewport.
The Monitor icon disables the object in all viewports.
The Camera icon determines if the object is rendered or not.

Read: https://docs.blender.org/manual/en/latest/editors/outliner/interface.html

Alternatively
The visibility of an object can also be set in the Visibility controls Object Properties.