So I have lots of cells or tables w/e their called idk Im no php expert! In some of them are urls like http://www. site.com/something-here All I want to do is remove the www. part from them all. How can I do that? Thanks!
Download your MySQL db as SQL file. Open them with notepad and replace the text. Then import those SQL file.
Hi @ kcitywd I see where you're going but its a bit more complicated than that I think? Replace what text do you mean? I need to import only certain things from the database and convert others into something else like the category number into a WP category and the url structure (slug) also. There's like 11 bits of data I need to import/convert and map `games` (`ID`, `title`, `url`, `swf`, `thumb`, `description`, `category`, `width`, `height`, `cheat`, `views`, `code`) If I can just get the basics like title, url, swf, thumb, desc, cat, width and height, cheat, views and code (game code/embed code) into a post all mapped correctly with the files showing correctly that will be a start. Cheers!
You will need to understand http://codex.wordpress.org/Taxonomies for customizing the url structure. Maybe your developer has created some custom post for "games". You will need some custom coding for that.
Oh yeah '/category/name' for category number conversion etc. Got it cheers. Yeah I have got someone on it now says he can do it just needs to add some custom fields in wp and hopefully use of several plugins for redirection etc and should be able to get it standing at least. Cheers.
I'm still a little unsure what you need, but if these are all stored in a database, why not just fetch them, and strip away the values / replace values as you use the fetched rows? If, for instance, you want to strip out www from each url (and only that), and perhaps also just for internal links, if there might also be external links, you could do something like this: $url = 'http://somedomain.com/this-is-a-post'; $tempurl = explode('http://www.',$url); $tempurl[0] = ($tempurl[0] == '') ? 'http://' : $url; echo join('',$tempurl); Code (markup): Could perhaps be condensed more... As I said, still unsure what you really need to do, but changing specific values (or, rather, avoid using parts of a string), can just as easily be adjusted on the return values, as in the database. Btw, why in the world do you want to skip the www-part of the domain? Any specific reason for that?
@ popsicle it is okay. I have got my threads mixed up not properly looking at what Im doing thought I was posting in my earlier thread I've managed to do that now the www thing. My colleagues wanted it to be like that as he wasnt using that version on his site and his WMT was giving him some weird 301 error message. He also took some dip in ranks and traffic/earnings so it could obviously be related as happened at same time. Now he wants to migrate to WP which should sort out his sitemap issues and the 301 error too. Fingers crossed. Cheers! Mike.