WordPress

予約語|WordPressで使ってはいけない名前

タクソノミーやタームのスラッグ名など任意で名前をつけるときに使ってはいけない名前があります。WordPressのプログラムの中ですでに役割が決められてしまった名前、俗に言う「予約語」というものです。これらの名前をスラッグ名などに使用していしまうと原因が一切分からない状態でエラーを起こしてしまうので気をつけてください。

「名前」と言っても「投稿」や「固定ページ」のパーマリンクだったら問題ありません。問題が起こるのは、ターム名やタクソノミー名など何かしらの設定で使用する場合です。任意の名前を付けるときは、下記の一覧に同じ名前が該当しないか気をつけましょう。

WordPressの予約語一覧

「Ctrl」+「F」キーでこのページ内に検索をかけて該当する名前がないかを確認してみてください。

attachment attachment_id author
author_name calendar cat
category category__and category__in
category__not_in category_name comments_per_page
comments_popup customize_messenger_channel customized
cpage day debug
error exact feed
fields hour link_category
m minute monthnum
more name nav_menu
nonce nopaging offset
order orderby p
page page_id paged
pagename pb perm
post post__in post__not_in
post_format post_mime_type post_status
post_tag post_type posts
posts_per_archive_page posts_per_page preview
robots s search
second sentence showposts
static subpost subpost_id
tag tag__and tag__in
tag__not_in tag_id tag_slug__and
tag_slug__in taxonomy tb
term theme type
w withcomments withoutcomments
year

最近の記事

  1. CSS

    擬似クラス「:first-child」「:last-child」はどうして効かな…
  2. CSS

    レスポンシブウェブデザインの基本|メディアクリエリの設定
  3. WordPress

    WordPressの立ち上げからサイト構築までの初期手順
  4. CSS

    CSS|中央寄せが効かないときは・・・
  5. CSS

    要素の配置が簡単に決まるFlexboxの使い方
PAGE TOP