• I have been using b2 for blogging for past 4 years. To upgrade to wordpress and to put all old posts to new wordpress database it took me long google search and testing. I have about 8000 posts. My posts are written in Croatian. Some title posts contain some special characters, for example:
    ?ing ?ing
    Its’ permalink looks like this:
    https://www.domain.com/cing-cing
    That’s how it’s suppose to look like.

    But problem is in my old (8000 posts) that contain special characters.
    In new wordpress (2.5.1) database in table wp_posts there is a field called post-name and it represents post permalink.
    While importing my old b2 database to wordpress, field post-name was not created correctly.

    Post permalink above, that was imported to wordpress looks like this:
    https://www.domain.com/aeing-eing

    There are more special characters but they are shown and imported correctly

    Is there any fast way to correct permalinks in this archive of 8000 posts? I hope that i want need to correct it manualy ??
    Thanks in forwrad

Viewing 3 replies - 1 through 3 (of 3 total)
  • you’re referring to ‘slugs’ not permalinks – permalinks are the entire URL.

    I did look for a plugin or tool to help you re-create your post slugs based on the post title, but I didn’t find anything that would do this for you.

    I’m not familiar enough with this to write you a function to make this change, but I hope someone here with a broader programming background will assist.

    Thread Starter ile

    (@ile)

    Thanks for replying.
    I know basics of php, it’s obvious that i will try to write a function tha would do this. I just dont know how to deal with special character replacement, but i will send report of my advancement if there’s going to be any ?? …and hope that someone will assist

    PS Odlicne fotke, kolega fotograf ??

    if you are comfortable writing your own query, this is the wordpress function which converts the titles automatically.

    Usually it doesn’t make such mistakes with slugs as you have, so I think maybe yours was an importing problem, perhaps?

    in wp-includes/formatting.php

    function sanitize_title($title, $fallback_title = '') {
    	$title = strip_tags($title);
    	$title = apply_filters('sanitize_title', $title);
    
    	if ( '' === $title || false === $title )
    		$title = $fallback_title;
    
    	return $title;
    }

    This is a very simple function however, so mistakes can happen.

    It would be relatively easy to use str_replace() with an array, to be sure to convert accented characters to plain versions.

    The problem is, your titles may already be converted to ‘HTML entities’

    Puno srece.

    ps: Ja sam pocetnik. Moje nisu nikakve, pogotovo pored tvojih. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP post permalink – Repost 8000 of them in database?’ is closed to new replies.