I recently watched Denis Villeneuve's version of Dune. It is mentioned that the sandworms are always attracted to artificial vibrations. I remember the books also mentioning multiple times that shields are useless and that any sound/vibration that is unnatural to the desert will immediately attract worms.
But is it mentioned anywhere why the sandworms don't attack the cities in which the Atreides and the Harkonnen live? Since none of them are Fremen, they are certainly not used to adapting to the desert. It is also explicitly shown that they use shields for general security and enjoy the general comforts of life.
I find it extremely hard to believe that such a lifestyle would not attract a sandworm. It is implied that the unnatural rhythms are very disturbing to sandworms and lead them into a huge frenzy. How then have they not attacked any city for over 100 years? The very act of beginning to build a city should have made the worms destroy everything in the vicinity!