Tag Info

Hot answers tagged

17

You are almost there. The function you need is sanitize_title_with_dashes( $title )


10

@nevster, The best permalink structure for seo is /%category%/%postname%/ This permalink structure gives you the most keywords loaded into the URL of your post. Since the category that you’ve placed your post under usually relates to the post title, you will have an extra SEO benefit if other websites use that permalink structure to link your post. EDIT ...


8

There is no documentation on it but you could always apply a filter to the_title like this: add_filter('the_title','some_callback'); function some_callback($data){ global $post; // where $data would be string(#) "current title" // Example: // (you would want to change $post->ID to however you are getting the book order #, // but you ...


7

Try putting this snippet in your functions.php <?php function rel_next_prev(){ global $paged; if ( get_previous_posts_link() ) { ?> <link rel="prev" href="<?php echo get_pagenum_link( $paged - 1 ); ?>" /><?php } if ( get_next_posts_link() ) { ?> <link rel="next" href="<?php echo ...


7

take a look at WordPress SEO by Yoast it will cover : 1) make the title of the page, the title of the post 2) make the description based on the first paragraph as for your #3 make the keyword meta by parsing the whole post, retrieve all the relevant word that are more that 3% occurrence, and fill the meta with them I highly doubt you ...


6

Decided to entertain the idea. Adapted from my snippet that changes anchors to collapsed domain names. Little too verbose, but seems to work. add_filter( 'the_content', 'anchors_to_page_titles' ); function anchors_to_page_titles( $content ) { preg_match_all( '/<a.*?href="(.*?)".*?>(.*?)<\/a>/', $content, $matches ); array_shift( ...


6

You can remove some of the header stuff with the following. // remove unncessary header info function remove_header_info() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'start_post_rel_link'); remove_action('wp_head', ...


6

By default the plugins are ranked by "relevance" and the only people who know how that algorithm is weighted work for wordpress.org (it's doubtful they are going to let anyone in on it). Downloads and rating are not the main components, just one of many including keywords, date, and how many beers you buy Otto. You don't have any options to rank high ...


5

From the WordPress SEO FAQ: ... either enable "Force rewrite titles" on the SEO -> Titles settings page, or go into your header.php and change the title element to just this: <title><?php wp_title(''); ?></title> Did you try that?


5

You'll find this post by Joost De Valk on changing WordPress permalinks to only include /%postname% very helpful. How many posts you have doesn't matter anymore if you are using the latest version of WordPress (at least > v3.3.1). I believe your permalink structure initially was — this /blog/%year%/%monthnum%/%day%/%postname%/ — and now, you are planning ...


5

Any reasons you couldn't put an anchor link to the actual page in your tab control? Then use jQuery to make sure it returns false and doesn't "work" for normal visitors. In fact, that's what the jQuery Tabs control page suggests: Tabs supports loading tab content via Ajax in an unobtrusive manner. The HTML you need is slightly different from the one that ...


5

Hi @CJN:, Your first question, moving the WordPress directory is handled differently from the rest. Moving WordPress from Subdirectory to Root: Go into /wp-config.php and add the following to defines (using your client's domain instead of example.com of course): define('WP_SITEURL', 'http://example.com'); define('WP_HOME', WP_SITEURL); 301 ...


5

Your rule works with the attachment ID, so I'm not sure how you're using the title, but the answer is almost identical in either case. The filter you want is attachment_link: function wpd_attachment_link( $link, $post_id ){ $post = get_post( $post_id ); return home_url( '/images/' . $post->post_title ); } add_filter( 'attachment_link', ...


4

Hi *@Bobby Jack:* You'll have absolutely zero problem given your number of pages and posts. If you were looking at 5000, 10k, 25k pages or more, then start to worry. And the real problem is with categories as the URL base in the current implementation of WordPress' URL routing (which I hope to see changed in v3.2 or v3.3): Category in Permalinks ...


4

Ideally, SEO should always be handled by the theme. Actually, most plug-in behavior that impacts the front-end of a site should be handled by the theme. Plug-ins like All in One SEO are quick solutions for people who don't want to invest the time required to re-code a theme they built, downloaded from a free site, or purchased from another developer. ...


4

Here's an answer from a slightly different perspective. Personally, I would love it if the theme handled all of the SEO issues itself, instead of an external plugin. But whenever I build a custom theme for a client, I include the All in One SEO plugin even though my theme is already packed with SEO goodness. The reason is because my clients aren't always ...


4

It looks like this is now a standard feature on Wordpress.com. http://en.support.wordpress.com/offsite-redirect/


4

ASCII characters will not cause any issues with search engines and they will be displayed properly. SEOmoz does this to avoid any chance of sql injection via its form fields.


4

SEO is not a thing that can be stockpiled and then expended. There are no SEO points. Absolutely different WordPress themes can effect how your site is indexed. Some themes are full of crap code. Some themes are full of junky outgoing links. Some themes look so ugly that user engagement will plummet. And so on. What theme do you have now, and what theme ...


4

WordPress select template, following its Template Hierarchy logic. What you have that is category archive, templates for individual pages are never considered for it. Also.. with the view of SEO, page.php is more important then category.php.. right? PHP template file is entirely back-end concepts, it doesn't have anything to do with SEO inherently.


4

Check your theme (header.php). If it uses something like this : <title><?php wp_title( '|', true, 'right' ); ?></title> You can use this filter : add_filter( 'wp_title', 'wpse104667_wp_title' ); function wpse104667_wp_title( $title ) { global $post; if( is_singular() && !is_front_page() && ...


3

To allow crawling of your WP site you need to go to "admin panel >> Settings >> Reading" right before the "Save Changes" button is a checkbox with the label Search Engine Visibility make sure this is unchecked.


3

I would not trust your SEO contractor on this one. The reason Wordpress does that by default is to attempt to feed search engines a page name that has words in it rather than an arbitrary database location. Google can use the words semantically to attempt to classify the page; whereas, they can't if the page is called ?p=31245 or whatever. Having all those ...


3

Yoast uses wp_head hook to output the meta description tag. Make sure you have this line in your <head>: <?php wp_head(); ?> For title tag, you can simplify the code by using one function call: <?php wp_title( '|', true, 'right' ); ?> The wp_title uses a filter (same name wp_title) to let users change the title tag. And Yoast uses ...


3

In order to play nicely with Plugins or other code that attempts to modify the HTML document title content (i.e. wp_title() output), you should always and only output this: <title><?php wp_title( '' ); ?></title> ...and if you want to modify that output yourself, filter wp_title instead of hard-coding anything inside the ...


3

To get a working nav menu WordPress needs to be set up complete. My suggestion is to use add_feed(). Ignore the name, you get text/html as output. Let's start with code <?php # -*- coding: utf-8 -*- /* Plugin Name: T5 Iframe Nav Menu Description: Display a nav menu in an iframe. Version: 2012.05.18 Refresh the permalinks after activation! */ ...


3

The best way of doing that is actually by just copying the post to your new blog, and on your old blog, add a rel="canonical" link to that page to your new post's URL. This will notify Google and other SE's that you want to have the other, new, page ranking, without actually having to annoy your users. There are several plugins that can do canonical, two of ...


3

Throw this into your functions.php: function clear_yoast_metadesc( $metadesc ) { return ''; } add_filter( 'wpseo_metadesc', 'clear_yoast_metadesc', 99, 1 ); If you set the $metadesc to empty like that, it won't be echoed. BTW, bulk editing is very hard on my to-do list, so you would be able to switch back completely :)


3

Hi @aj martin: Here's two different solutions (editing the specifics for your use case): Doing a Redirect: 1.) At the top of your /wp-config.php file add the following: if ( is_yoursite_blogger_domain( $_SERVER['SERVER_NAME'] ) ) { $domain = str_replace( 'www.', '', $_SERVER['SERVER_NAME'] ); define( 'WP_SITEURL', 'http://' . $domain ); define( ...


3

The problem is that your author pages are marked with the noindex tag, look at the page source: It must be a plugin that is doing that, that is not the default setting. If you don't want the duplicate pages, try a plugin like Yoast WordPress SEO that let you add Nofollow to comment links.



Only top voted, non community-wiki answers of a minimum length are eligible