BRUSSELS—The European Union on Thursday turned up the pressure on internet companies, including Alphabet Inc.’s Google, Facebook Inc. and Twitter Inc., unveiling sweeping guidelines for speedily scrubbing terrorist and other illegal content from their websites.

The move comes amid pressure from some national governments to make such companies legally liable for the information that appears on their platforms.

The...