Check If Taxonomy A and Taxonomy B has same Slug, 301 Auto Redirect Tax A to Tax B if True in WordPress

Question

Please How do I achieve this?

I have WordPress Default Taxonomy – Tag and a custom Taxonomy – Artist.

I want to check for TAGS that have the same slug as ARTIST and 301 redirect it to the ARTIST.

Example Check If: website.com/tag/drake and website.com/artist/drake have the same slug which is true.

then

Automatically 301 Redirect: website.com/tag/drake to website.com/artist/drake

If the slug is not the same, then do nothing.


I found this Answer but it’s not exactly what I need and I don’t know how to make it solve my problem. I am very new to WordPress development.

Thanks

0
Joe Titus 1 month 2022-04-11T15:49:46-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse