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

multisite - How to populate a Wordpress install with a lot of categories, quickly?

programmeradmin3浏览0评论

I'm looking at starting a new project, but I've not done anything like this before. I'm hoping someone with more experience will be able to offer me advice on this one.

The site revolves around geographical structure. It's the UK, cut into 50 parts. Each part has many towns, and within each town, many services. Each of the 50 sites will be a different URL, all running on a multisite.

It's going to take quite a while to set up the first area, and all the towns. All towns and services will be categories in the admin panel. Once this is done, I need a fast way of populating the other 29 installs! I'll be seeking a way to effectively "find and replace" town names, so that page titles, meta and categories can be re-used over and over. Is this possible? How would you tackle this? At the moment, I've no real ideas, apart from sitting here with PHP and seeing if I can pass a huge array of towns through a function which adds categories for each town and inserts them into the database...

I know this isn't a question, like "how do I fix this code" but I don't know how to plan for this, and with no plan I think I'm stuffed :)

I'm looking at starting a new project, but I've not done anything like this before. I'm hoping someone with more experience will be able to offer me advice on this one.

The site revolves around geographical structure. It's the UK, cut into 50 parts. Each part has many towns, and within each town, many services. Each of the 50 sites will be a different URL, all running on a multisite.

It's going to take quite a while to set up the first area, and all the towns. All towns and services will be categories in the admin panel. Once this is done, I need a fast way of populating the other 29 installs! I'll be seeking a way to effectively "find and replace" town names, so that page titles, meta and categories can be re-used over and over. Is this possible? How would you tackle this? At the moment, I've no real ideas, apart from sitting here with PHP and seeing if I can pass a huge array of towns through a function which adds categories for each town and inserts them into the database...

I know this isn't a question, like "how do I fix this code" but I don't know how to plan for this, and with no plan I think I'm stuffed :)

Share Improve this question asked Apr 26, 2013 at 15:43 Dan Dan 4642 silver badges14 bronze badges 2
  • You could write an SQL to insert the data right into the database. So in the case off adding categories. You would need to add the category to the wp_terms, to the wp_term_taxonomy table and to the wp_term_relationships table. You could so as you suggested. Have all town in a array, and run it in a FOR loop to insert each category. – gdaniel Commented Apr 26, 2013 at 21:14
  • Yes, confirms my thoughts. MySQL is probably the way forward here. I need to get my learning MySQL book back out...so much to learn! – Dan Commented Apr 29, 2013 at 13:27
Add a comment  | 

1 Answer 1

Reset to default 0

I would think WP All Import & WP All Export would help here.

  1. You can create 1 category, 1 service etc.... (i.e 1 end point) in the website,
  2. Use WP All Export to export a CSV of the post type in question,
  3. Edit the CSV to include all of the data you need,
  4. Use WP All Import to import the CSV into your post type,
  5. Repeat for each site.
发布评论

评论列表(0)

  1. 暂无评论