WordPress.org

Ready to get started?Download WordPress

Forums

Custom Title, Description, and Keywords per Post/Page (4 posts)

  1. jamiew
    Member
    Posted 8 years ago #

    The goal: On each post/page to be able to specify a custom title, description, and set of keywords.

    Why: Client's request for Search Engine Optimization.

    Example: Client site sells a mold training course, and tools and equipment to help those trained perform the work. On the training pages they would title tag on the
    Mold Training and Certification
    page to be "Mold Inspection Training, and Mold Remediation Training" to get the write phrases in there for the search engines. However, on the Equipment and Supplies Page the would like the title to read "Mold Remediation Equipment and Mold Clean Up Equipment" for the same reasons as above.

    WhatI've Tried/Considered: I just can't figure out how to do this.

    Please help! There has to be a way to do this. I have no problems editing the php code, using plugins, whatever.

    ps. Yes I have read the MetaTags Page, and it doesn't seem to apply.

  2. DmitriyLyutikov
    Member
    Posted 8 years ago #

    It's easy. Use get_post_meta() function.

    For example. How to make custom <title> tag:
    1) Add custom field 'title' for every page
    2) Edit your header template. Use something like that:
    <title><?php echo get_post_meta($wp_query->post->ID, 'title', true); ?></title>

    PS: Sorry for my english

  3. Catboatguy
    Member
    Posted 7 years ago #

    It seems like you can create a title for every post, but the overall category pages, and the index page will not have a title. Can you put in an if..then..else statement that would display the custom field "title" if it exisits for that page, or if not, default to the standard title and post date?

    I don't know php, but it seems it would be something like:

    \
    <title>
    <?php
    if (!empty "title")
    {
    ?>
    <?php echo wp_title() && " " && the_time('l, F jS, Y') ?>
    }
    <?php
    } else {
    ?>
    <?php echo title() ?>
    </title>
    \

    I know the syntax is way off, but then again I told you I don't know PHP.

  4. Kafkaesqui

    Posted 7 years ago #

    "The goal: On each post/page to be able to specify a custom title, description, and set of keywords."

    Title
    The normal functionality in WordPress is not enough here? Then Dmitriy's reply points to a possible solution for this.

    Description
    My Head META Description plugin is worth a look:

    http://guff.szub.net/2005/09/01/head-meta-description/

    It provides a description based on an excerpt of the content, the excerpt text itself, or a custom field ('description') value for every post or Page. But there are other plugins out there which handle description tags:

    http://codex.wordpress.org/Plugins/Meta

    Keywords
    There are several plugins for this as well (check same link above).

Topic Closed

This topic has been closed to new replies.

About this Topic