最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Possible to remove taxonomy from permalink if uncategorized?

programmeradmin5浏览0评论

I'm working on a client's website who requested that the custom search functionality I'm building out provide a number of 'pretty' permalinks that they can use for ad campaigns.

The post types I'm working with are community, floorplan, and ready-made homes, and they want to be able to have direct links to search results by county and community.

To achieve this, I set up taxonomies that would create nicely formatted URLS such as {county}/{community}, {county}/{community}/{floorplan} {county}/{community}/{ready-made}.

This is all working fine, however it leads to some issues. For example, If you do not specify a county in your search, you will get links like uncategorized/{community} returned in the results.

Is there any way that you can remove uncategorized taxonomy from the URL, but leave the taxonomy in if it exists?

I've figured out how to update the URLs in the search results, however they will lead to 404s if left completely empty because they technically don't exist if you remove the taxonomy from the url. Ideally, I would want them to just redirect to communities/{community} for example, instead of communities/uncategorized/{community}

发布评论

评论列表(0)

  1. 暂无评论