Rewrite URL – how to do a SEO-friendly Unicode custom URL?

If you write your post titles in Bānglā but set the post slug in English, you can do this: function wpse117090_pre_post_link( $permalink, $post ) { return str_replace( ‘%posttitle%’, sanitize_title( $post->post_title ), $permalink ); } add_filter( ‘pre_post_link’, ‘wpse117090_pre_post_link’, 10, 2 ); Then change your permalink structure to, for example, /%postname%/%posttitle%/ (Please note that the above code … Read more

Filtering categories in the permalink structure

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 … Read more

NoFollow Entire Website

Thought this was a great question so I went digging. In default-filters.php on line 208 there’s add_action(‘wp_head’, ‘noindex’, 1); as of WordPress 4.1. The noindex() function in turn checks to see if you have set blog_public option to 0. If you have, it calls wp_no_robots() which is simply: function wp_no_robots() { echo “<meta name=”robots” content=”noindex,follow” … Read more

Adding rel=”next” & rel=”prev” for paginated archives

Try putting this snippet in your functions.php <?php function rel_next_prev(){ global $paged; if ( get_previous_posts_link() ) { ?> <link rel=”prev” href=”https://wordpress.stackexchange.com/questions/36800/<?php echo get_pagenum_link( $paged – 1 ); ?>” /><?php } if ( get_next_posts_link() ) { ?> <link rel=”next” href=”<?php echo get_pagenum_link( $paged +1 ); ?>” /><?php } } add_action( ‘wp_head’, ‘rel_next_prev’ ); ?> And if … Read more

Robots.txt not updating

Once I experienced the same issue, this is what I did to fix the issue. Edit the robots.txt file directly (using FTP/SSH), User-agent: * Disallow: /wp-admin/ Disallow: /wp-includes/ There are two reasons if the robots files not updated when you edited using a plugin. File permission. Some other plugin is reverting the changes. Also try … Read more

How to remove dates from existing permalinks?

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 … Read more

Can YOAST SEO fields be removed from custom post type [duplicate]

So as noted in the comments above, I found a solution and used this code to do it: function remove_yoast_metabox_reservations(){ remove_meta_box(‘wpseo_meta’, ‘reservation’, ‘normal’); } add_action( ‘add_meta_boxes’, ‘remove_yoast_metabox_reservations’,11 ); In this instance, “reservation” was my custom post type. And “wpseo_meta” was the ID of the metabox. So the same code can be used on any meta … Read more