Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • The threewp-broadcast plug-in seems like a very bad idea. It appears to create duplicate copies of each post, so the actual post ends up having multiple permalink URLs. A superior solution would be to list posts in categories on multiple blogs, but have those categories link back to the single permalink page on the blog from which the post originated.

    If I’m misunderstanding, I’d welcome corrections. As it stands, threewp-broadcast seems to create SEO problems.

    I can’t answer why your two canonical URLs are different, but on the homepage I would guess the search engines will not be confused. On any other url, the trailing slash is potentially significant, but that doesn’t appear to be a problem here.

    Do you use Platinum SEO or All in One SEO Pack plug-ins? Probably one of those is generating the second canonical link tag. I believe you’d see comments such as:
    <!-- platinum seo pack 1.3.2 -->
    before and after the second canonical link tag; if so, that identifies the plug-in.

    WordPress 2.9.2 (possibly dating back to 2.9.0) includes a rel=canonical tag for every page for which is_single() returns true — which I think means all posts and all pages, but not the homepage, tag pages, category pages, date archives. In any case, as of the 1.3.2 version of Platinum SEO Pack plug-in, this means that all the is_single() pages will have two rel=canonical tags.

    Because the Platinum SEO plug-in creates a canonical URL for _every_ page, not just the is_single() pages, my solution was to disable the tag coming from wordpress itself. To do so, edit the functions.php file from your theme, or create one if necessary, with this line:

    remove_action( 'wp_head', 'rel_canonical');

    Note that if you are creating a new functions.php, you’ll need the file to contain the PHP tags, e.g.:


    <?php
    remove_action( 'wp_head', 'rel_canonical');
    ?>

    The same file can disable many of the unnecessary link tags in the doc header; see:
    https://wpengineer.com/wordpress-header/

    Forum: Plugins
    In reply to: Noindex for Author pages
    recordinghacks

    (@recordinghacks)

    Actually, the All In One SEO plug-in *does* put NOINDEX on author pages. The plug-in apparently considers author pages to be part of the “archives” option — meaning, if you check the box for “use NOINDEX on Archives,” then you’ll get NOINDEX on author pages too.

    To waterhasnoenemy, don’t get stressed about noindex. If google sees duplicate content on your site, it will simply filter the duplicate pages out of the SERPs. If you’re not sure what to do regarding noindex, don’t do anything at all. It’s unlikely this will have a noticeable impact on your search traffic.

    The fix for this turns out to be relatively easy; I’ve put it into a simple plug-in with about 3 lines of actual code. See URL below.

    This solution is not necessarily plug-and-play, though, because it will hand The Loop an object containing both posts and pages, interspersed. This may not be what you want. You’ll almost certainly want to modify your authors template (author.php) to process posts and pages separately; e.g., you could have two iterations of the loop, with the first skipping pages and the second skipping posts. Hint: within the loop, $post->post_type will be either ‘post’ or ‘page’. Don’t forget to use rewind_posts() between the two loops.

    Anyway, the challenge with showing pages for authors is not simply retrieving them, as I suggested in my earlier message here. By the time the author.php template runs, in 2.5 anyway, WordPress has already served a 404 header for author-page requests if no posts were found. This means it’s necessary to either disable the 404 header, or have WordPress retrieve posts and pages at once (for author requests anyway).

    Other solutions around the web advocate adding a test (&& is_author()) to handle_404() in classes.php, so that author-page requests don’t send a 404 even if no posts are found. The problem with this is that requests for bogus author names will also pass — there’s no validation of authors at this point. Also, this sort of mod gets overwritten when you update WordPress. No fun.

    Some digging revealed that the parse_request() function in classes.php runs external filters against the request terms, prior to querying the database. For author requests, the $this->query_vars object contains a single term, ‘author_name’. My plugin tests for this term; if the term is found, the plugin appends another value to the array, setting ‘post_type’ to ‘any’.

    Setting that value here overrides a default value of ‘post’ that would otherwise be set downstream. This simple change causes WordPress to retrieve both posts and pages for author-page requests. The correct 404 behavior for nonsense author names is retained.

    The plug-in is known to work for version 2.5.1 and not tested anywhere else.
    https://debris.com/misc/includepagesforauthors.phps

    There does not seem to be an easy way to do this, as of wordpress 2.6 anyway. I have not found a function to return “all pages by this author,” which I think is what kgagne and I need.

    wp_list_pages() claims to accept an author parameter, but it outputs the results directly rather than returning them as an array to the calling code, which is what I need (so the calling code can determine if there are any pages by a given author, for example).

    Pages are stored in the wp_posts table, just like posts are; they are distinguished by the post_type column, which contains ‘page’ for pages and ‘post’ for posts. So it shouldn’t be difficult to write the function necessary…

    Forum: Fixing WordPress
    In reply to: Author Not Correct

    Well, I must be getting tired. The query is actually simple, so I’ve just tried it:
    insert into wp_usermeta values (null, 1, 'wp_user_level', 10);

    This creates the missing ‘wp_user_level’ row for the admin user (user_id 1).

    This definitely fixes the immediate problem of the admin user not appearing the Post Author drop-down. Whether it has long-term consequences is another question.

    Forum: Fixing WordPress
    In reply to: Author Not Correct

    My WordPress installation has the same problem. I had been using the admin account for posting. I set up a ‘flickr’ account to test posting via Flickr.com, and this worked fine, but when logged in as ‘admin’ I was not able to change the author of the items posted from Flickr. The admin account did not appear in the “post author” pulldown menu.

    Tonight I renamed the admin user (via SQL, directly in the database), and this made the problem worse. As described above, now every post I create is attributed to the Flickr user.

    There is *no* overlap in name or nickname here.

    The problem appears to be in the wp_usermeta table. At least in my case, user_id 1 (the former admin user) has no row for meta-key=’wp_user_level’.

    The code that draws the Post Author pull-down calls a function get_editable_user_ids(), which runs this query:
    SELECT user_id FROM wp_usermeta WHERE meta_key = 'wp_user_level' AND meta_value != '0'

    My user ID does not appear in the results set, because it has no wp_user_level row.

    Probably the only fix is for me to create a new admin user and migrate all my posts to it, and simply abandon the current admin user. What a pain.

    Theoretically I could add a row for user_id 1 to give it a wp_user_level in this table, but I don’t know what appropriate values for the rest of the columns are.

    The wp_rel_nofollow() filter appears to be broken in 2.5.1 — when I add the suggested line to default-filters.php, the category list rendered on my site’s homepage has escaped quotes:

    <li class=\"cat-item cat-item-3\"><a href=\"https://example.com/foo\" title=\"View all posts filed under Colophon\" rel=\"nofollow\">Colophon</a> (10)

    I worked around this bug by cloning the wp_rel_nofollow() function to a new name and removing this line from it:
    $text = $wpdb->escape($text);
    and then updating default-filters.php with my new function name:
    add_filter('wp_list_categories','wp_rel_nofollow_mgm');

    Voila! Category links are nofollowed and there are no ugly escaped-quote issues in the source.

    recordinghacks

    (@recordinghacks)

    @otto42, the youtube-brackets plug-in seems like a questionable recommendation, for two reasons:
    a) the plug-in homepage and the author’s entire site seem to be offline — robertbuzink.nl is showing spammy search results from “Sedo’s Domain Parking”.
    b) the plug-in doesn’t work, at least for me. I fixed it by changing the first line of code to look like this:
    $stag = "[youtube=https://www.youtube.com/v/";

    The original had a slightly different URL format.

Viewing 9 replies - 1 through 9 (of 9 total)