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

categories - Edit tag_id in category pages of dashboard

programmeradmin7浏览0评论

When we create a category, WordPress randomly assigns a tag_id for that category. Is it possible to change that ID in the category section?

For example I create a category X and it is assigned tag_id=12. I want to change that to tag_id=1. Any solution ?

When we create a category, WordPress randomly assigns a tag_id for that category. Is it possible to change that ID in the category section?

For example I create a category X and it is assigned tag_id=12. I want to change that to tag_id=1. Any solution ?

Share Improve this question asked Jun 25, 2016 at 2:33 PeterPeter 11 silver badge1 bronze badge 1
  • 1 XY problem, why do you need to do this and why. It seems that you have another issue – Pieter Goosen Commented Jun 25, 2016 at 7:57
Add a comment  | 

2 Answers 2

Reset to default 1

No, you cannot (easily) choose what tag ID is assigned. It's not random - it's the next ID available after the last one that was created in the database.

If you really want to control tag IDs, you'll need to clear your database and start fresh, and create each tag in the order you want their IDs to be (and you won't be able to change them afterwards without potentially breaking things).

However, if you need this, there's probably something else you're not doing right...

It is possible for intermediate-advanced users to change this by modifying the Wordpress database directly, however this is usually not recommended. For example, to change category with tag_id=21 to tag_id=9999, you could run direct database queries like:

update wp_terms set term_id=9999 where term_id=21;
update wp_term_taxonomy set term_id=9999 where term_id=21;
发布评论

评论列表(0)

  1. 暂无评论