Keep WordPress blog up to date [SEO]

To signal the search engines that something happens on your blog

  1. What can I do?
  2. The code
    1. random_post_menu.php
    2. random_post.php
  3. Conclusion
 Keep your blog up to date. 
Look at old posts again and adapt them.

I’ve been busy with SEO-related topics lately and came across a tip, which sounds very logical to me. You always have to keep your old posts up to date to keep them in good position on Google.

What can I do?

I write posts daily and can not always stay on the “published posts” page and pick out random ones.

That’s why I wanted to write a script, which redirects me to a random unchecked post and marks it as checked.

The code

I created two files.

  • random_post_menu.php
  • random_post.php

I then included the random_post_menu.php in my functions.php.



I wrote this file to be able to get a random post in the backend at any time and, if necessary, to reset the statistics.

add_action( 'admin_menu', 'register_menu_page' );

function register_menu_page(){

add_menu_page( 'Check random', 'Check random', 'manage_options', 'random_post_redirect', 'random_post_page', 'dashicons-update', 5 );
add_submenu_page( 'random_post_redirect', 'Reset checked', 'Reset checked', 'manage_options', 'reset_checked', 'random_post_page' );


function random_post_page() {
	if($_GET['page'] == 'random_post_redirect') require_once("random_post.php");
	if($_GET['page'] == 'reset_checked'){
		foreach (get_posts(array(
			'lang' => '',
			'posts_per_page'   => -1,
			'meta_query' => array(
					'key'     => 'checked',
					'compare' => 'EXISTS'
		)) as $checked) {
		?><script type="text/javascript">window.location.href = "<?= get_admin_url() ?>";</script><?php

add_action( 'admin_menu', 'random_post_redirect' );


This file is for the identification of an unchecked post and the forwarding to a random unchecked post. I wrote that so I can access it anytime.

For example, I could mail me daily or weekly, reminding me to check a post. If this file is linked, the forwarding will happen automatically.

if ( !defined('ABSPATH') ) {

$posts = get_posts(array(
	'lang' => '',
	'posts_per_page'   => 1,
	'orderby' => 'rand',
   'meta_query' => array(
         'key'     => 'checked',
         'compare' => 'NOT EXISTS'
?><script type="text/javascript">window.location.href = "<?= ''.$posts[0]->ID.'&action=edit' ?>";</script><?php


By using this feature permanently, you can signal to Google that your blog is developing organically and doesn’t get outdated.

If somewhere on the page, the search engines also can see when the page was last updated/modified, it can also be clearly assigned. You can pass this informations through structured data. How I did that you can read here:


Bing Experience Google php Program SEO Tips WordPress

Beitrag teilen

WhatsApp it

Folgen Sie uns