May 4, 2011

Assign categories and tags from dump file | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
Assign categories and tags from dump file
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
April 25, 2022
2:35 pm
Avatar
ninja321
Member
Members
Forum Posts: 84
Member Since:
August 26, 2013
sp_UserOfflineSmall Offline

Hello,

I wonder if the following should work out of the box or if I am doing it wrong:

Import Dump with Categories and Tags: Categories (Dump field “Categories”) get assigned to WP Categories and Tags (Dump field “Tags”) to WP Tags. Categories should be created if not already there.

This does not work as expected. When not using any php code, categories get created yes, but tags transform also to categories.

When using “$post[‘tags_input’] = explode(‘,’, $post[‘custom_fields’][‘tags’]);”, the tags from the dump transform to tags AND categories. (I set tags->tags before)

When using “$post[‘tags_input’] = explode(‘,’, $post[‘custom_fields’][‘tags’]);” AND $post[‘categories’] = array(); tags are only tags which is correct but the only the “uncategoried” category is set, no new categories get created.

 

So what do I need to do if I want the tags from the dump file to be the WP tags and the categories to be the WP categories? I hope this is possible without heavy php code or so?

April 26, 2022
2:17 pm
Avatar
CyberSEO
Admin
Forum Posts: 3636
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Do you disable this option: Login to see this link?

April 26, 2022
2:28 pm
Avatar
ninja321
Member
Members
Forum Posts: 84
Member Since:
August 26, 2013
sp_UserOfflineSmall Offline

Yes, this is disabled

Is this something that should usually work normally with dumps? One thing I noticed, not sure if it is related, the dumps have the xml tag <category> and not <categories>

April 26, 2022
3:02 pm
Avatar
CyberSEO
Admin
Forum Posts: 3636
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

I think I will be unable to help w/o looking at the actual CSV file. Please send it to me by email along with the instruction on how to replicate your feed setting including your custom PHP code.

April 26, 2022
4:10 pm
Avatar
ninja321
Member
Members
Forum Posts: 84
Member Since:
August 26, 2013
sp_UserOfflineSmall Offline

email sent

April 26, 2022
5:43 pm
Avatar
CyberSEO
Admin
Forum Posts: 3636
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Actually that’s a little bug in the plugin (it looks for “post_tag” instead of “post_tags”). So your code must be written like this:

Login to see the code

But I don’t think it’s good idea to do it. The bug will be fixed in the next release and you won’t need any custom code to make it working as expected. I mean your “Custom PHP code” box should be empty for the following dump settings:

Login to see the quote

April 26, 2022
10:32 pm
Avatar
ninja321
Member
Members
Forum Posts: 84
Member Since:
August 26, 2013
sp_UserOfflineSmall Offline

Hey, just to be sure, I just want to mention the tags actually worked with the PHP snipped I had before, the categories were the problem. And using your new tags code results in only having the “uncategorized” category and no other categories or tags. Not really complaining, as I can wait until the update, just trying to help.

p.s. when deleting $post[‘categories’] = array(); and keep your new snippet it results in having the tags + categories from the dump file both as WP categories

April 27, 2022
1:56 am
Avatar
CyberSEO
Admin
Forum Posts: 3636
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Fixed. No snippets needed in your case. Please make sure to update to the latest version.

April 27, 2022
9:59 pm
Avatar
ninja321
Member
Members
Forum Posts: 84
Member Since:
August 26, 2013
sp_UserOfflineSmall Offline

I noticed that and it works with the categories but the tags don’t transform to “Tag1” and “Tag2”, they transform to “Tag1, Tag2”

so “Tag1, Tag2” transforms to one tag

April 28, 2022
2:05 pm
Avatar
CyberSEO
Admin
Forum Posts: 3636
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Also fixed.

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 64

Freedom: 61

MediFormatica: 49

B8europe: 47

saviulisse67: 45

Member Stats:

Guest Posters: 338

Members: 2603

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 4

Topics: 1519

Posts: 7668

Newest Members:

FDJEZ, test.test, david_alija, paypal.orasmarketing, brad.lee.coates, Thatcham Town Radio

Administrators: CyberSEO: 3636