Blogger Import - odd a2a {} code now showing
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Blogger Import - odd a2a {} code now showing
We have using Blogger Import Extended to import a Blog site to Wordpress.
It took hours. But now on each blog we are seeing this code:
[text]var a2a_config = a2a_config || {};
a2a_config.linkurl = "www.sitename.blogspot.com";[/text]
With "sitename" being the name of the blogspot.
Any ideas what it might be? I've looked it up and there is some sort of "addtoany" script, but I don't want that to be there, because we are moving the site away from blogspot.
The only other thing I can think of, is to look it up int he database, see how it is shown, and do a replace all of that for nothing.
It took hours. But now on each blog we are seeing this code:
[text]var a2a_config = a2a_config || {};
a2a_config.linkurl = "www.sitename.blogspot.com";[/text]
With "sitename" being the name of the blogspot.
Any ideas what it might be? I've looked it up and there is some sort of "addtoany" script, but I don't want that to be there, because we are moving the site away from blogspot.
The only other thing I can think of, is to look it up int he database, see how it is shown, and do a replace all of that for nothing.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Blogger Import - odd a2a {} code now showing
If this is saved in the post content in the database, then yeah, large scale find and replace is probably the fastest option.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Blogger Import - odd a2a {} code now showing
Damn thing has variants. I did try that, but it removed the odd one.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Blogger Import - odd a2a {} code now showing
If I did a search for it, it found it if I just searched for a portion of it. But because maybe one has a space, or something like that, it just finds 1, 2 and that's it. Not all of them.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Blogger Import - odd a2a {} code now showing
Having only the two lines above to go on, couldn't you simply remove any line containing 'a2a_' ?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Blogger Import - odd a2a {} code now showing
No, because that is a 2% portion of what's in the Post.
Think of it like a big Blog site. maybe 200-300 words, and that tiny portion in the head or the base of the code that's in the DB.
Think of it like a big Blog site. maybe 200-300 words, and that tiny portion in the head or the base of the code that's in the DB.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Blogger Import - odd a2a {} code now showing
Right, that's how I was thinking of it, but your example showed them each on their own line. If that's not the case, maybe you need to look at building a regex to match those segments.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Blogger Import - odd a2a {} code now showing
Sorry how do you mean? I want to remove them from the DB, as this is a Wordpress site, and dont' want to mess up the Post pages.
Bizarrely, when you run a query for how many have the full code, it's around 588, but when you do a Replace, it finds 1 or 2. How is that possible?
Bizarrely, when you run a query for how many have the full code, it's around 588, but when you do a Replace, it finds 1 or 2. How is that possible?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Blogger Import - odd a2a {} code now showing
Code: Select all
SELECT * FROM `wp_posts` WHERE post_content LIKE '%var a2a_config = a2a_config || {};
a2a_config.linkurl = "www.site.blogspot.com";%'
UPDATE wp_posts
SET post_content = REPLACE(post_content, 'var a2a_config = a2a_config || {};
a2a_config.linkurl = "www.site.blogspot.com";', '')The second script replaces just 8! How is that possible???
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Blogger Import - odd a2a {} code now showing
WP isn't really relevant here. You have a DB table with some contents you need to alter.simonmlewis wrote:this is a Wordpress site, and dont' want to mess up the Post pages.
I don't really have enough information to answer that.simonmlewis wrote:Bizarrely, when you run a query for how many have the full code, it's around 588, but when you do a Replace, it finds 1 or 2. How is that possible?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Blogger Import - odd a2a {} code now showing
I thought you meant use that code in the page. I want to remove them from the database tables.
A post_content field might contain something like this:
I need shot of that var..... "; text. They are all the same, but oddly, as I said, doing a SELECT finds them all. Doing a REPLACE, doesn't.
A post_content field might contain something like this:
Code: Select all
var a2a_config = a2a_config || {};
a2a_config.linkurl = "www.website.blogspot.com";
Having just returned from my first skiing holiday I am now belatedly aware how family-friendly the sport is and how, if children learn early, you can look forward to many happy hours on the slopes in future years. <br />
<br />
If youcontent content bla bla
<b><i><br /></i></b>
<b><i><br /></i></b>
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Blogger Import - odd a2a {} code now showing
Might be easiest at this point to pull the pages down, fix them in PHP, either by removing those lines -- they do appear to be on separate lines in this example -- or with regex, and then writing the results back to the DB.