How to not allow url search by date?

Hello,

I would like to modify my child theme, specifically my archive.php.
I would like that if someone searches by the url using like www.mysite.com/2017/01 it wouldn’t make appear the archive page by month but the 404 page.

Is there an easy way to do that?
Because I am able to make some stuff work in php code but the archive.php code is a bite to complicated for me to understand.

Previously I had removed all the code in archive.php and replaced it by the 404.php code but even if for the archive search it was working it was not working anymore for the category and it is important to me that this search works.

Thank you for your help.

Camille

Hi Camille,

I hope you are well today and thank you for your question.

You can try achieving this by using the following solutions.

Best Regards,
Movin

Hello,

thank you again for your answer.

The 2 first one links are linked to the “search” button and this is not exactly what I wanted.
But the Smart Page archive remove plugin is EXACTLY what I wanted :slight_smile:

So thanks again, it helps me a lot.

Have a nice day.

You are most welcome here :slight_smile: