• Quick question if anyone has some ideas for me to try. We have a 3rd party who are using the “tag” parameter to send data to the website for tracking purposes, and they are not able to change this.

    So the problem we have is changing the tag base via permalink to something like “my-tags” doesn’t solve the issues. Because when the data is sent to http://www.domain.com/?tag=trackID this will redirect to http://www.domain.com/my-tags/trackID which gives a 404. Disabling redirects will also give a 404 because that parameter “tag” is still in use by WordPress and even though i have change the Tag Base to “my-tags”, with redirects disabled it still will try and show posts for http://www.domain.com/?tag=trackID, which of course gives a 404 because there is no Tags for that.

    Does anyone know if it is possible to free up that parameter in anyway?

    Hope this makes sense.

    Cheers!

    • This topic was modified 9 years, 2 months ago by Solonox.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Use the “request” filter to unset the “tag” query var passed to your callback. This will make it impossible to use tags in any query. If this causes difficulty, the rewrite rule for tag requests needs to be replaced with a different version that uses a different query var. This different query var needs to be added in the “query_vars” filter whitelist. Then use the “pre_get_posts” action to properly set the initial “tag” query var from the term passed in the different query var.

    Thread Starter Solonox

    (@solonox)

    bcworks, thanks for the suggestions, much appreciated. Just going to get started on this now, will leave a message here with the results. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Tag Base Slug + Tag Parameter’ is closed to new replies.