rgordon83
02-03-2009, 03:21 PM
Ok, so if you are scraping from Yellow Pages you may find that not all listings have websites. But for the ones that do, you may want to set up your post template so that you can make them clickable hyperlinks.
Only problem is for all the blank cells with no URL you will get HTML for a url, but with no actual URL. That can't be god for SEO.
So here's what i did.
First make your template so it calls in the website URL. since yellowpage listings don't have the "http://", we'll add it:
<a href="http://[website]" target="_blank" />[website]</a>
that will call in the website so it is clickable and opens in a new window.
But the problem is for all the posts with no url, your post will have this:
"<a href="http://" target="_blank" /></a>"
and that's bad.
But as far as i know, there is know easy way to bulk edit the HTML in wordpress posts. So we're gonn do in in phpMyAdmin.
So to your phpMyAdmin and find your wordpress database. then click the "Browse" icon next to WP_posts field.
Then click "export" at the top of the page. On the export page tick off the "Add drop table" box and export as a ,sql file.
Copy the file and paste into your favorite text editor. I use textWrangler (http://www.barebones.com/products/textwrangler/)
Do a ctrl F and replace <a href="http://" target="_blank" /></a> with nothing. that will delete them all. Save the file as a .sql
Go back to your phpMyAdmin screen and click "import" link at the top. upload the file.
Say "Presto Chango" 5 times and Whalla! all your posts without links are good to go!
Only problem is for all the blank cells with no URL you will get HTML for a url, but with no actual URL. That can't be god for SEO.
So here's what i did.
First make your template so it calls in the website URL. since yellowpage listings don't have the "http://", we'll add it:
<a href="http://[website]" target="_blank" />[website]</a>
that will call in the website so it is clickable and opens in a new window.
But the problem is for all the posts with no url, your post will have this:
"<a href="http://" target="_blank" /></a>"
and that's bad.
But as far as i know, there is know easy way to bulk edit the HTML in wordpress posts. So we're gonn do in in phpMyAdmin.
So to your phpMyAdmin and find your wordpress database. then click the "Browse" icon next to WP_posts field.
Then click "export" at the top of the page. On the export page tick off the "Add drop table" box and export as a ,sql file.
Copy the file and paste into your favorite text editor. I use textWrangler (http://www.barebones.com/products/textwrangler/)
Do a ctrl F and replace <a href="http://" target="_blank" /></a> with nothing. that will delete them all. Save the file as a .sql
Go back to your phpMyAdmin screen and click "import" link at the top. upload the file.
Say "Presto Chango" 5 times and Whalla! all your posts without links are good to go!