If you’re using the GeneratePress Premium theme for your WordPress site, you’ve probably noticed that when you click the “Read More” button in your blog posts, GeneratePress automatically adds the #more keyword to the end of the URL or permalink. This URL structure is considered unfriendly for search engine optimization (SEO). In this article, I’ll show you how to easily fix this issue.
Removing #more from URLs Using the Theme Editor
- Log into your WordPress admin area.
- Hover over “Appearance” and select “Theme Editor”.
- Locate and open the function.php file.
- Copy and paste the following code at the end of function.php:
add_filter( 'generate_more_jump','generate_disable_more_jump' );
function generate_disable_more_jump()
{
return '';
}
- Save the changes to the file.
After doing this, #more will no longer be added to the URLs of your blog posts.
Code Explanation:
- add_filter(‘generate_more_jump’, ‘generate_disable_more_jump’); – This line adds a new filter to the existing generate_more_jump filter in WordPress.
- function generate_disable_more_jump() { return ”; } – This is a custom function that returns an empty string when WordPress calls it through the generate_more_jump filter.
Removing #more via a Child Theme
If you are using a child theme for GeneratePress, the best way to make the change is to create a new functions.php file in the child theme folder and add the code above to it.
This method is preferable because any changes made directly to the parent theme may be overwritten when the theme is updated. Using a child theme protects your modifications from being overridden.
Alternative Method Using the WPCode Plugin
If you don’t want to edit your theme files directly, you can use the WPCode plugin instead:
- Install and activate the WPCode plugin.
- Go to “+ Add Snippet” > “Add Your Custom Code (New Snippet)”.
- Paste the same code into the new snippet.
- Select “Code Type” > “PHP Snippet”
- Add a name for the snippet and press save
- To apply the code snippet across your entire WordPress site, toggle the checkbox at the top of the Code Snippets admin page from “Inactive” to “Active”, then click the “Update” button. This will run the snippet globally instead of just on specific pages or posts.
Both of these methods will completely remove #more from your links in the GeneratePress Premium theme, making your URLs more appealing for search engines.