Limit records displayed in a view using hook_views_query_alter on a Drupal 6 website Probably at some time you will need to modify some view's output by code... So, here's how you can for example limit the output to a certain number of records... 1. Implement a hook_views_query_alter in your custom module