Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressでユーザー登録日を表示する方法

WordPressでユーザー登録日を表示したいですか?よく人気の会員制サイトやフォーラムでは、プロフィールに「member since 2015」のようにユーザー登録日を表示することがあります。今回はWordPressでユーザー登録日を表示する方法を投稿します。

Showing a the date of a user's registration in WordPress

ユーザー登録日を表示する場所と方法

ユーザーページの管理カラムにユーザーの登録日を表示したい方もいるでしょう。これにより、ユーザーがいつサイトに参加したかを簡単に把握することができ、登録日順に並べ替えることができます。

もう一つの使用シナリオは、「プロフィール編集」ページにユーザーの登録日を表示することです。これにより、管理者やユーザー自身がいつサイトに参加したかを確認することができます。

最後に、おそらく最も一般的な使用シナリオは、あなたのサイトのフロントエンドの公開プロフィールにユーザーの登録日を表示したい場合です。

では、これらすべてを行う方法を見てみましょう。

管理エリアのユーザーページに登録日カラムを追加する

まず最初にAdmin Columnsプラグインをインストールし、有効化します。有効化したら、設定 ” Admin Columnsでプラグインを設定します。

Add registered column in users table

管理カラムタブでユーザーをクリックし、カラム追加ボタンをクリックします。

次にTypeドロップダウンメニューで’Registered’を選択し、store updatesボタンをクリックします。

これで、ユーザー画面に「Registered」という新しいカラムが表示され、ユーザーがWordPressサイトに登録した日付が表示されます。

Users table with registration date column

WordPressで管理カラムを追加・カスタマイズするためにできる他のことをご覧ください。

ユーザープロフィールに登録日フィールドを表示する

プロフィール編集ページに登録日を表示するには、カスタムプラグインをサイトにアップロードする必要があります。

メモ帳のようなテキストエディターを使ってコンピューター上に新規ファイルを作成し、membersince.phpとしてデスクトップに保存してください。

次にそのファイルを開き、以下のコードを貼り付けます。

[cbk1]

ファイルを保存し、WordPressサイトにアップロードします。

最後に、FTPクライアントを使用してWordPressサイトに接続し、/wp-content/plugins/フォルダに移動します。コンピューターからmembersince.phpファイルを選択し、アップロードします。

これで、WordPressのプラグインページに移動し、サイトでこのプラグインを有効化することができます。

これですべてです。WordPressの管理エリアでユーザープロフィールを編集して、ユーザー登録日が表示されていることを確認してください。

Showing member registration date in WordPress user profile

サイトにユーザー登録日を表示する

この方法では、WordPressサイトのフロントエンドにユーザー登録日を表示する簡単なショートコードを使用します。

まず、テーマのfunctions.phpファイルまたはサイト固有のプラグインに以下のコードを追加する必要があります。

[cbk2]

次に、このようなショートコードを使うだけで、ユーザーの登録日を表示することができます:

[SKX1]

peterを表示したいユーザー名に置き換えてください。

この投稿がWordPressのユーザープロフィールに登録日を表示するのにお役に立てば幸いです。WordPressの登録にユーザープロフィールのフィールドを追加する方法についてのチュートリアルもご覧ください。

この投稿が気に入った場合は、WordPressの動画チュートリアルをYouTubeチャンネルに登録してください。Twitterや Facebookでもご覧いただけます。

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

アバター

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

18件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Tom says

    Hello :) Nice code thank you but is it possible with the shortcode to show the register date of the user which actually logged in?

  3. Ralph says

    TYPO: There is one typo in the code in method 3 that results in the error of date always showing the same value: On line 37 is
    $udata = get_userdata( $user-ID );

    while it should be:
    $udata = get_userdata( $user->ID );

    (Notice the arrow instead of the dash)

  4. chergui djaouida says

    please i need to introduce the date of registration of a user in a php code not by a shortcode how to do?

  5. Isabelle Laplante says

    «Showing Registration Date Field in User Profile» costum Plugin works but do not show the real date… For every users, the added information is«Member since: Jun 2015» … Wich is not the case… Can you help?

  6. Jody Hockley says

    Hi,

    Thanks for the plugin, nice easy fix for a simple problem.

    I have just used the second option to show in the User profile page. However it only show month and year, not the day. How would I alter the plugin code to show the day too?

    Thanks for your help, much appreciated

    Jody

  7. Gerard says

    Very nice :).
    I needed only first code snippet (which works).
    Just one little note: on line 37 you should make it ‘$user->ID” you forgot the ‘>’, else it shows notices when debuggin.

    Thank you.

  8. Davis says

    Admin Columns plugin developer requires $60US to sort by registration date. If you are a site manager, find a better solution. WP should include this ultra-basic functionality in all WP installs.

  9. Hemang Rindani says

    Insightful article. WordPress is the most user friendly CMS that can create complex websites with very less or no technical knowledge. It comes with rich set of modules and plugins that can transform your digital dream into a reality. However, it is important to identify the secured and authenticated tools for your WordPress website to improve the overall website security. WP is capable of handling multiple sites with multiple users which has been a requirement of big organizations. WP provides some great features to manage user accounts and prevent the website from unauthorized access using certain plugins with your website. There are also tools to enhance the user experience like the one described in the article to provide a great personal feel to the user.

    Thanks for the article.

  10. Patrick Catthoor says

    This looked like a feature I could use for my website. So, I tried all 3 methods.
    Method 1 works like a charm, but both methods 2 and 3 always provide the same date: 01 January 1970. Something must be wrong, but I couldn’t figure out what.
    Any ideas?

    • Celito C. Macachor says

      I realize this is an old issue, but I just came across this article after a recent search. Great, insightful articles, but I have the same concern as Patrick’s. In the all users list, the registration date is correct. While it is not critical, only one date (July 2016) is shown for all users in the Member since field. Has this issue been resolved? Thanks for any updated information.

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。