Skip to content
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

Wordcount of page seems to be incorrect #29

Closed
roman-schuermann opened this issue Dec 20, 2018 · 6 comments
Closed

Wordcount of page seems to be incorrect #29

roman-schuermann opened this issue Dec 20, 2018 · 6 comments
Assignees
Labels

Comments

@roman-schuermann
Copy link

In our project we use YoastSeo (0.0.5) and the word count of a given page seems to be not correct and therefore the value for keyword density is not correct also.
The Yoast Plugin counts: 4918 words but actualy there are only 841 words on the page (only content).
Is this a bug or a bad configuration?

@Sebobo Sebobo self-assigned this Jan 30, 2019
@Sebobo
Copy link
Collaborator

Sebobo commented Jan 30, 2019

Sorry just now saw the issue. But thanks for reporting, I'll check it out!

@Sebobo
Copy link
Collaborator

Sebobo commented Jan 30, 2019

Hi @roman-schuermann, is it possible for you to provide me the link or source code of your example?

I just checked on my site and the word count is 99% correct on a few pages I checked.

@roman-schuermann
Copy link
Author

Hi Sebobo,
thanks for your effort. We already solved this issue, reason was additional content (for displaying a modal for eg. privacy policy or imprint) on that page. This additional content was also taken into account for the wordcout...

We solve it by removing this content, but maybe you have a solution to exclude this kind of content from the wordcout? It would be fine, because otherwise we have a lot of changes for our customer...

Thanks in advance

@Sebobo
Copy link
Collaborator

Sebobo commented Jan 30, 2019

There is a selector in the page parser which selects the content that the Yoast library will analyze. This could be made configurable. So for example instead of parsedPreviewDocument.querySelector('body').innerHTML one could provide a custom selector via the settings to select a content wrapper excluding the content for modals etc...

Sebobo added a commit that referenced this issue Jan 31, 2019
@Sebobo
Copy link
Collaborator

Sebobo commented Jan 31, 2019

Hi @roman-schuermann,

I implemented the feature and need to test it a bit with different Neos versions.
Therefore it's available in master for now.

See https://github.com/Sebobo/Shel.Neos.YoastSeo#contentselector.

@Sebobo
Copy link
Collaborator

Sebobo commented Feb 25, 2019

@Sebobo Sebobo closed this as completed Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants