The new Coronavirus is spreading rapidly and it has taken the lives of many people so far. The virus has destructive effects on the human lung and early detection is very important. Deep Convolution neural networks are a powerful tool in classifying images. Therefore, in this paper a hybrid approach based on a deep network is presented. Feature vectors were extracted by applying a deep convolution neural network on the images and effective features were selected by the binary differential meta-heuristic algorithm. These optimized features were given to the SVM classifier. A database consisting of three categories of images as COVID-19, pneumonia, and healthy included 1092 X-ray samples was considered. The proposed method achieved an accuracy of 99.43%, a sensitivity of 99.16%, and a specificity of 99.57%. Our results demonstrate the suggested approach is better than recent studies on COVID-19 detection with X-ray images.