I import my custom terms from a desktop program using MySQL queries. But all the terms lead me to a 404 page. I tried flushing rewrites many times, it didn’t help. It only helps when I save individual terms at https://[mysite]/wp-admin/term.php?taxonomy=store-category&tag_ID=[int ID]
I create my custom taxonomy like this
Then I insert my terms into my database:
That’s it. I’ve got a term in wp_terms
, it’s connected to taxonomy in wp_term_taxonomy
.
Then, each product has its $import_group[‘id’], I just look for it in meta_value in wp_termmeta
and insert the returned term_id as the term_taxonomy_id in wp_terms_relationships
.
Looks like I’ve got everything covered, but when I go to [site root]/store-category/[term-slug]/, it leads me to a 404 page. What am I doing wrong? Is there any other place I have to insert term related data to? wp_options?
Flushing rewrite rules does not help (tried many times). Also, the number of posts shown under each of the terms is 0 (wrong), maybe this is related. Also, when I go to a term’s wp-admin page and save it, this fixes the 404 issue for this term. But I can’t do it manually, too many terms.
I’ve read this, this and similar questions but all the answers seem to be variants of ‘try to flush rewrites again’, which I did.
Oh, and I’ve just noticed. The same happens with individual posts: 404 until I refresh their term.
I tried deleting data from rewrite_rules in wp_options too, no use.
I changed ‘rewrite’ => true to ‘rewrite’ => false, and I don’t get 404 page now, but still no idea how to fix the issue with rewrite turned on.
All irrelevant plugins are deactivated
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com