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
Tags in Wordpress article don't show up as hashtags #182
Comments
|
One thing I just noted is that the title, which is defined as It seems as if some sanitization or stripping of HTML tags is done before delivering these posts. Hashtags in |
|
Mastodon has a very strict filter, and afaict strips out everything but |
|
@mediaformat the |
|
I think it would be great to just have post tags added as hashtags in the ActivityPub post. This keeps your page content clean while still using hashtags on the ActivityPub side. |
|
You already can do that using the placeholders |
|
@bocops & @dustinrue if you go to the plugin settings you can control the output of the ActivityPub posts. Currently I'm using a Custom format as follows: |
|
@timnolte My custom format in Wordpress looks the same, but hashtags simply won't show up in the resulting post when viewed by different Mastodon users. |
|
I didn't even think if custom formats, ty for the tip on that |
|
I am experiencing this currently. I use the %hashtags% in the template and get nothing. Just to test this out, I took your help text of existing template fields then cut-and-pasted into my format. Here is the link to what happened. https://elk.zone/mastodon.lol/@dave@evilgeniuschronicles.org/109637179720056151 Every other field was populated but the tags was empty. If you click through to the Wordpress post you will see there are definitely tags on the post. |
|
I am spending my Saturday night inserting logging code into the live plugin on my website. Hot times. Here is what happens when I write a post. I see it going through all the steps in generate_the_content a few times. I suspect each of those is a time when the autosave happens. Then it goes through when I publish, generates content with no tags in it and that's what gets published to Mastodon followers. Then after all that it gets called again, gets the tags and generates the content again with the tags but it has already sent the toots off. This is why it is not working. What I don't understand is what is making this timing happen. Hopefully y'all (in particular @pfefferle ) have a better grasp of it. I went back and added logging at the top of get_the_post_hashtags. It is getting called each time, but all the times before send_post_activity() that returns nothing. After it gets called again that last time, after the actual activity is sent, the tags exist. |
|
I've talked to @evilgeniuschronicles the last few days and can confirm his findings. For what it's worth, if I edit if ( ! $tags ) {
return 'This text should never appear for posts with tags!';
}Then this string will appear in all resulting Mastodon statuses, even if the post did have tags. This means that the abovementioned placeholder replacement works, but that WP's |
|
FWIW, @evilgeniuschronicles found a workaround and shared it with me that might help users encountering the same issue, and might also help track down why this bug exists in the first place: If the Wordpress post isn't posted immediately, but instead scheduled (even just some minutes in the future is enough), then the resulting AcitivityPub post as viewed for example via Mastodon will contain the post tags as hashtags, as long as the template is set up correctly. This, combined with the fact that this bug did not appear for all of us in the first place, seems to suggest that timing issues might be the cause, perhaps via the use of |
|
@bocops and @evilgeniuschronicles nice debugging! that helps a lot, I will have a look why the tags might not be included if the post is sent to quickly. |
|
I have one last question: How do you generate the tags? Are these the tags that are added via the classic tags frontend of the editor or the hashtag feature ActivityPub implements? |
|
In my case, it was the tag editor in the front end. Even when adding tags first before writing the post, I got the empty get_the_tags() behavior during publish. |
|
Same here, I added "tags" in the Wordpress editor for them to be added to the resulting ActivityPub object via Adding hashtags to the content directly still seems to have other issues. At least Mastodon doesn't seem to recognize them, and instead displays simple text. Not sure if this is a related issue or something else at the moment. |
|
Is this still an issue with version 0.16.1? |
|
@pfefferle Just tested this once, but looks good to me! As far as I am concerned, this can be closed unless others still see the problem. Thanks for the fix! :) |
|
Thanks for your answer @bocops . I will close this issue for now, please re-open if still a problem. |
|
I tested on my blog with 0.16.1 . I still see the problem. The wordpress posts have odd permalinks, but I did comment to Matthais' mastodon account in a reply to my test post. I set up the tags in the right-hand column of the post section prior to publishing. I did the immediate "Publish" and did not get the tags in the post when it arrived in Mastodon. |
|
What do you mean by "the permalinks are weird"? You seem to use shortlinks, if you want to have the permalinks, you have to change your settings. |
|
@evilgeniuschronicles can you send me your message config? |
I mean the permalink to the actual Mastodon post that results is weird. If there is a trick for finding the link in the Mastodon context I don't know it. The permalink points back to Wordpress. |
|
This is how the permalink should work! It should point to the WordPress post. |
|
That's fine. It just makes it difficult to point out to you how this problem gets realized, since it shows up in the Fediverse in a way that cannot be pointed to directly. |
|
Sorry, but I still see no problem. |
|
It looks like it should look like. |
|
Top post, the one that was scheduled has hashtags in it. The bottom one, published by hitting the "Publish" button, does not. Both posts had the same three hashtags added in Wordpress prior to publish/schedule. |
|
Ah, we are talking about the hashtags! I was confused because you always talked about the permalink! |
|
I only talked about the permalink because it makes it hard to show you the hashtag problem. AFAIK screenshotting is the only option because I can't otherwise show you how it shows up in Mastodon. |
|
@pfefferle If you want to follow from your Mastodon account @dave@evilgeniuschronicles.org that will cut out a middleman and you'll see my tests directly. I know this issue is me complaining but I do appreciate your efforts. This is not a super-high priority to me since there is a trivial workaround but I can see this confusing new installers. |
|
Should finally work with 1.0.x |




After installing the plugin, when writing an article on my Wordpress blog and adding tags to the article, no hashtags appear in the resulting post visible on Mastodon, not even as simple text.
Things I've already tried after consulting with Matthias directly:
The text was updated successfully, but these errors were encountered: