Update RSS Language Value

WordPress-Christmas-13And today opens the 13th door of our Advent Calendar. You cannot only use a language key for your blog, but also for your feed:<language>en</language>. WordPress also has provided an option, but not easy to maintain.
However, it is advisable to use the key according to the codec and therefore I show you some ways.

Via database

Search directly in your data base for the key (option_name) rss_language and maintain the value of your language, for example de. You can find the key values on this page.

Via Hook

Alternatively you can do it with a function of WordPress. You just have to put the following syntax in the functions.php of your theme and a call of the admin or frontend is enough; it’s enough to set the value once. After that you can remove the code from your template.

function update_rss_language() {
	update_option( 'rss_language', 'de' );
}
add_action( 'admin_init', 'update_rss_language' );

Comfortable in the settings

The last possibility is a little more comfortable and puts another field in the General – Reading area. There is another field, which allows to maintain the value.
wp-rss-language

You have to put the following code in a Plugin or in the functions.php of your active theme.

function rss_language_string() {
	?>
	
	language codes.'); ?>
	

Posted

in

by

Comments

2 responses to “Update RSS Language Value”

  1. Dion Hulse (dd32) Avatar

    A faster way to set it once, Is to use WordPress’s option.php page:

    1.open /wp-admin/options.php
    2. scroll down to rss_language
    3. Change the value
    4. Scroll to the bottom and hit save changes.

  2. Frank Avatar

    Yes, you are right – we have also a door on the advent calendar with this tip. Thanks for reading WP Engineer!