Hot answers tagged

22

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


12

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 ...


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

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

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 ...


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

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

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

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

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

This should be possible. First, you're lucky that www.mytravelblog.com/jakarta/myPostName/ already works, it shows you the post and doesn't redirect you to the longer version (at least it seems to work on my side). That means you only have to work on the generated link, and not mess with the way incoming URLs are handled or "canonicalized". The result of ...


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

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() && ...


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

Although I would advice you to avoid this and use a plugin for this work. Because only a dedicated plugin can help SEO. "WordPress SEO" from yoost is a great plugin for SEO. That being said, here is the code for adding meta description and keywords in header. Paste this in theme's functions.php file. function add_meta_tags() { global $post; if ( ...


3

Didn't try this myself (self-hosted from the start), but this seems fitting guide for your situation: How to Migrate your Blog from WordPress.com to a Personal Domain ( Digital Inspiration )


3

Provide content that people crave to find, consume and share. There is no technical solution to make site popular. If there was one - everyone would use it and field will be leveled again. There are a lot of minor tweaks to implement (heading structure, social buttons, etc), but none of those will automagically bring in traffic and none of those work ...


3

In response to EAMann: means you don't need to worry about upgrades potentially breaking your site if they introduce new bugs that conflict with other systems you're using If you DON'T use a plugin, you potentially risk the complete loss of functionality when you change your theme. If you use AIO, or Headspace, you can change your themes ...


3

Actually your site is indexed all 176 pages. It would probably help your search results if you changed your permalink structure to something other than default. You should also get a yourself a Google Webmaster Tools account so you can see how your site gets indexed and crawled.


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.


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

you can add a filter in your functions.php add // Nofollow in content add_filter('the_content', 'my_nofollow'); function my_nofollow($content) { //return stripslashes(wp_rel_nofollow($content)); return preg_replace_callback('/<a[^>]+/', 'my_nofollow_callback', $content); } function my_nofollow_callback($matches) { $link = $matches[0]; ...


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 :)



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