Google News plugin
Displays N first news items from a selectable Google News RSS feed, inline or as a widget.
Google aggregates news from over 4500 news sources, updated continously. The results can be retrieved as a number of RSS feeds, where you can create your own specific feed by specifying one of more than 40 regions/languages, and an optional topic ranging from Domestic to Most Popular to Entertainment. Currently there are nine topics, including, of course, All. In addition to this, any feed can be filtered through a search query so that only news items matching your query will be shown. Note that not all combinations of region/language and topic has been enabled by Google but it should degrade gracefully.
This plugin works both as a widget, as inline content replacement and can be used in themes. It can be used as both simultaneously, but there can be only one instance of the widget. Multiple feeds can be configured and used accordingly.
NOTE! Always upgrade to the latest version if you experience problems, most things are fixed already.
The latest version is 2.5.
If you’ve configured feeds that use character sets like cyrillic, arabic and you’re getting errors from WP when trying to view the feeds then your WP MySQL database tables may be created with the wrong character set. Let me know and I’ll give you some pointers.
If you have a question or other comment, use the form below. Thank you!
Known bugs:
- There is a bug in the WordPress RSS engine, that sometimes show up when people use this widget. If you get something resembling “unknown function debug() in line 504 of wp-includes/rss.php” then that’s one of them. WP is aware of the problem, and apparently a fixed rss.php might be showing up in the next release. As a quick-fix edit wp-includes/rss.php and change line 503 from if ( MAGPIE_DEBUG ) { to if ( MAGPIE_DEBUG > 1 ) {
- When the widget fails with a php error like the one above, the template goes out of whack. I’ve made sure none of those are my fault in the next minor upgrade due out soon. I’m looking at better workarounds for the bug above first, so release might be a short while yet. Don’t want to spam you all with multiple releases like some widget writers…
Example of inline content replacement.
Default feed <–google-news–>, alternating randomly between two feeds:
Google News : Norge : All
A different feed <–google-news#non-default–>:
Google News : العالم العربي (Arabic) : All
Shortcode test non-default [ google-news name="non-default" ]:
Google News : U.S. : All
- Iran starts processing nuclear fuel towards weapons-grade strength - Times Online
- World Digest: International observers say Ukrainian election was free and fair - Washington Post
- Rep. Murtha, a force on Hill, dies | Philadelphia Inquirer | 02/09/2010 - Philadelphia Inquirer
- GOP Wary of Pitfalls in Obama's Health Care Summit - ABC News
- Abbas mulls peace talks; expects US answers soon - Reuters
- US Marines gear up for major Afghan assault - AFP
- Feds may close locks to stop carp - Chicago Tribune
- To Ace This Interview, Palin Keeps Notes Close - New York Times
Shortcode test default [ google-news ]:
Google News : U.S. : All
- Iran starts processing nuclear fuel towards weapons-grade strength - Times Online
- World Digest: International observers say Ukrainian election was free and fair - Washington Post
- Rep. Murtha, a force on Hill, dies | Philadelphia Inquirer | 02/09/2010 - Philadelphia Inquirer
- GOP Wary of Pitfalls in Obama's Health Care Summit - ABC News
- Abbas mulls peace talks; expects US answers soon - Reuters
- US Marines gear up for major Afghan assault - AFP
- Feds may close locks to stop carp - Chicago Tribune
- To Ace This Interview, Palin Keeps Notes Close - New York Times
Shortcodes are only available in WordPress 2.5 and up.









May 12th, 2009 at 16:59
On sstern.ccim.com/ccim-newsccim-news/, I get “invalid URL” with the plugin. The code is [google-news name="CCIM News"]. It appears that the link generated for a story is
OK… your board won’t let me post a link.
It seems that there’s an ampersand missing before “url=”.
June 5th, 2009 at 14:02
Hi Joe!
Sorry about the abysmal reply time, been moving house. About the filtering. Yes, it’s just a very limited filter support in the plugin at the moment. I could add more features here with very little job, I just wasn’t sure if the filtering was a feature people would bother to use at all. Apparently it is, so I’ll expand it a little. The query method provided by google here is a bit of a pain, as you can’t just give it the old “something+OR+something+else” string. You have to pass individual search parameters to different cgi script variables depending on whether you want say AND or OR. Haven’t looked at the api lately though, so they may have come up with something better.
OK
June 5th, 2009 at 14:04
Hi Steven!
Sorry about the late reply, been moving house. Not quite sure what’s wrong based on your error message. I’ll send you an email and see if we can clear things up.
OK
June 16th, 2009 at 22:25
HELP! My client wants to eliminate the words “Google News : U.S. : All” from the top of our google feed.
Is this possible? I looked at the coding, but it doesn’t seem very easy to do. If you have suggestions, please share them.
Thank you!
)
June 22nd, 2009 at 19:04
Hello – can anybody tell me how to REMOVE the words “Google: US: All” at the top of this plug-in? My client doesn’t want it to show up, but I can’t find where the code is.
Thanks!
C
June 23rd, 2009 at 09:44
Hello friend:
I installed your plugin and I can see the widget on my blog without any problem.
However, when I click on the feed links, I get to a non valid address.
This happens with any news on any link of the google news feed.
Any idea,
Thanks a lot
June 26th, 2009 at 13:56
Hi Osvaldo!
I’ll have a look. Can you provide me with the feed definitions you have? I.e. language, location, etc so that I can replicate your setup here?
OK
June 26th, 2009 at 14:01
Hi Cynthia!
In the Feed definition, you have an optional “Admin-defined title”. You can set this to whatever you want. Note that Google Terms Of Use require you to show that the feeds come from Google. Hope this helps.
OK
July 1st, 2009 at 00:37
This plugin is great! Worked first time, and without coding I made a widget and added to my front page. But: I’d really like to have a second widget, with a different news selection. It seems I can only have one Google News widget — is that right? Or can I make one by putting the shortcode into some other widget?
July 1st, 2009 at 11:44
Thanks, your plugin works perfect, except from news from Norway. Nothing shows up from Norway. Hvorfor ikke det??
July 2nd, 2009 at 07:53
When I peview it looks okay, but when I publish, the titles don’t wrap around and the links are not active. WP 2.8.
July 2nd, 2009 at 11:26
Hi KenN!
At the moment you can only have one widget yes, I’ll look into the possibilities of having multiple widgets from the same plugin. But as you say you can use the shortcode and/or WP function calls more or less anywhere you want, so you can get more than one news listing per site that way. The PHP Code plugin (that lets you put arbitrary PHP code into a widget) may also be a possibility here.
OK
July 2nd, 2009 at 11:31
Hi John!
Fordi
As noted in the readme, there are combinations of locations and news types that do not work, e.g that Google do not have an rss feed for. For example, Kenya may not have an Entertainment feed but perhaps a Business feed etc. There isn’t a list of what works and what doesn’t, so you’ll just have to test. The “All” type should work for all locations, including Norway.
OK
July 2nd, 2009 at 11:39
Hi Shawn!
I took a look at your site, and your posting #196 containing the Google News output looks to be working fine?
OK
July 2nd, 2009 at 14:30
Hi, i being using your plugin , google news ,
out put i have it set to with image,
i only see the image but no text displaying
i have tried using only txt and still only image shows.
any clues.
thank you
July 26th, 2009 at 15:40
Hi!
Thank you for the plugin. It seems to work okay as a widget, but not when inserted in a post. My site displays a summary of the last few posts, and the there are no links – unless you open the post itself. The second problem is that for some weird reason I cant get it to use the ‘long’ version, and I find that the short version is a bit messy. I would love to have a mouseover text-box as you have on this site as well, is that possible? I tried also having us news in the widget and uk news in a post, but it ends up displaying the same one.
Any ideas how I can solve this?
And one more thing
Is there any way I can display world news? The CNN plugin wont work, and CNN is still quite US based…
Thank you again
July 27th, 2009 at 12:44
Hi Iris!
Your first problem, where your summaries do not include links, sounds like a theme-problem. Perhaps your theme strips all links from the summaries? Should be fairly easy to fix if that is the case, but it has to be done in the theme.
As for the long vs short version, what kind of output do you get from the long version. Nothing at all? Have you tried for “U.S.” and “All”? I’ve never had that problem before, where you get the short but not the long output. They’re just different ways of displaying the exact same rss feed, so if one works so should the other. The messiness comes from Google I’m afraid, they screen scrape news sites and pass the result on to the RSS feed more or less without any cleanups. The plugin does quite a bit of cleanup, but can’t catch all the strangeness that comes along.
The mouseover textbox is default for the plugin, so if you’re not seeing those on your short-type feeds then I’m pretty sure that’s due to something in your theme and/or CSS-files. The plugin use on this site is completely stock, just unzipped the plugin and defined a couple of normal feeds for testing.
The CNN plugin doesn’t work for you either, or was that a typo for Google plugin? I’m presuming the latter. Look for an updated CNN plugin in a couple of days, where I’ve added more international feeds. But you will most likely see exactly the same problems there, as both plugins are more or less indentical internally.
Do you have a web site I can look at to see your problems live?
OK
July 27th, 2009 at 22:34
Their TOS seems to say we can’t use their feed on a web page. “You may only display the content of the Service for your own personal use (i.e., non-commercial use) and may not otherwise copy, reproduce, alter, modify, create derivative works, or publicly display any content.”
I was hoping to select my topics, possibly display as blog posts.
July 28th, 2009 at 13:00
Hi mugger!
Yeah, their TOS is a bit on the strict side. I’ve vaguely interpreted it in such a way that you can put the feed on a blog as long as you only display the links/short descriptions and not the complete articles, don’t pretend the content is your own (i.e. keep Google/newspaper attribution) and not make too much money off it. But if you’re planning to become a news site and/or fill your blog with complete news articles that someone else have written then you’re way outside their and anyone elses TOS and should consider another approach.
OK
August 3rd, 2009 at 22:05
Hi, I really like the idea of this widget, but can’t seem to get it to work. What am I doing wrong?
Thanks!
August 6th, 2009 at 10:43
Hi David
It’s difficult to guess what your problem might be without more information. What happens when you install the widget. Does it show up at all? Have you tried instead adding short-code to a post (or a PHP Exec widget)? Email me a link to a test page where you have added the widget and I’ll take a look. Emailing olav at the obvious domain name will reach me.
OK
August 20th, 2009 at 13:04
Hi
Great widget but when I filter the news with ‘Hampshire’ it still displays the same articles…it seems to ignore the filter.
Thanks
Toby
August 29th, 2009 at 12:51
Hi, i being using your pluging at the begining , I did an update and the option to be able to see image with txt description .
Output type: with image Item length: Long
click on the link so you could see what i get.
lamaskeproduce.com/?page_id=3421
My only option is to use Output: with image Item lenght: short to get small description but no image.
lamaskeproduce.com/?page_id=3509
But still don’t get no image,
Thank you , in advance
Rasco
September 5th, 2009 at 02:40
Hi,
I am having a problem with the widget. I have numerous feeds defined, but when I select something other than “DEFAULT” and click save, it reverts back to “DEFAULT”. I assumed I am doing something wrong but can’t seem to figure it out.
Cheers & Thanks in advance,
Rob
October 9th, 2009 at 18:14
Nice pluging. Thank you.
How do I make it display in the same font and size as the rest of my sidebar? I’ve tried altering my theme’s style CSS, but I’m not a programmer. Can you help? Thanks again.
October 21st, 2009 at 09:38
great plugin.
I consider filtering crucial and of significant added value. Thus it would be very helpful if you publish a short ‘guide’ or ‘manual’ on the search strings (query strings) applicable. I am thinking of AND, OR, NOT, compound words as e.g. “financial crisis”, etc.
Thanks in advance.
Cheers
Mat
November 17th, 2009 at 14:53
Hello Olav,
i use your Plugin on several blogs. Good work.
November 23rd, 2009 at 18:11
I have the plugin working fine. One problem I’m having is that I have text only set, but, some stories only have a photo. I do not want stories with photos posted at all.
Example:
Post 1. Story text here.
Post 2. photo only with link to story
Post 3. story text here
How can I fix it so that stories without any text will not be posted as a photo? Thanks!