In the rapidly evolving landscape of network communication systems, the need for robust security measures has become paramount due to increased vulnerability to cyber threats. Traditional Intrusion Detection Systems (IDSs) face challenges in efficiently handling redundant features, leading to increased computational complexity. This research addresses these challenges by proposing two optimized IDSs leveraging Grey Wolf Optimization (GWO) combined with deep learning (DL) models. The first system integrates Gated Recurrent Unit (GRU) with GWO (GRU-GWO), while the second utilizes Long Short-Term Memory (LSTM) with GWO (LSTM-GWO). These systems aim to enhance feature selection, reducing dimensionality and improving detection accuracy. The NSL-KDD and UNSW-NB15 datasets, representative of contemporary network environments, were employed to evaluate the proposed systems. Experimental results demonstrate significant improvements in intrusion detection accuracy and computational efficiency, underscoring the efficacy of the DL-GWO approach in enhancing network security. The first approach (GRU-GWO-FS) increased accuracy to 90% and 79% for anomaly and signature-based detection on the UNSW-NB15 dataset, compared to 80% and 77% with all features. The second approach (LSTM-GWO-FS) achieved 93% and 79%, compared to 82% and 77%. On the NSL-KDD dataset, GRU-GWO-FS improved accuracy to 94% and 92%, and LSTM-GWO-FS to 94% and 92% for anomaly and signature-based detection, respectively.