-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gatsby-source-wordpress] Remove "Continue reading" links #8782
Comments
I think this isn't such a good idea since there may end up being many other places like this. Little workarounds in each case is going end up being painful. I think the better solution is to use the search and replace content urls option from the source plugin to just remove it entirely and make it a relative link in every case everwhere: searchAndReplaceContentUrls: {
sourceUrl: 'https://wordpressurl.com/',
replacementUrl: '/',
}, Then use wordpress to build your site structure from each pages link. In gatsby node instead of using the slug of the page to create the page you can use the link since it's just a path now. There is another big benefit to doing it this way which is that you can now easily use wordpress menus as actual menus since all the pages in wordpress and gatsby have the exact same url. At that point, all routing will be setup in wordpress. Even the frontpage setting will work. |
@TylerBarnes Good feedback, you're right, specifically removing that exact I think being able to perform arbitrary transformations on all content from WordPress would be super useful. In fact, come to think of it, it could be a super useful plugin to apply arbitrary transformations on any imported data. Not sure what's involved in creating such a plugin though. Would a PR that adds a |
Hmm, yes I guess that would break images. Seems like a more advanced search/replace could be warranted, I'm not really sure who maintains the wordpress source plugin and who would make that call. |
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open! |
Hey again! It’s been 30 since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
@chmac if you're interested I ended up making my own gatsby wordpress source plugin! It adds a ton of features that |
Summary
WordPress includes "Continue reading" links inside it's
excerpt
field. For example:These links include the full URL of the WordPress site.
My suggestion is to remove this entire link. To strip out the entire
<p class="link-more"
tag.Motivation
WordPress in this case is a source of content, not a frontend. The mixture of links between them both is confusing. It's possible to hack around this problem inside Gatsby, but that requires changes from the user. There is almost no scenario in which an
<a href=...
to the WordPress site is a good idea.EDIT: Forgot to say, I'm happy to work on this and file a PR, just wanted to check in before starting on it to see if it's a well supported idea or not.
The text was updated successfully, but these errors were encountered: