#wordpress 2018-03-06

2018-03-06 UTC
brokaw, tantek, [kevinmarks], [snarfed] and [asuh] joined the channel
#
[asuh]
When saving a new note, the permalink defaults to the Post ID for me. However, every new post appends a new suffix of `-2`. So, a new post could look like `https://example.com/123-2` instead of `https://example.com/123`. Is there a fix for this?
[miklb] joined the channel
#
[miklb]
I had that problem for awhile could never figure out why.
#
GWG
That's weird.
#
[asuh]
miklb what did you do to get past this?
#
GWG
I've never noticed that
#
[miklb]
For me it seems to have fixed itself. I never did figure out what it was.
#
[asuh]
On another thread I asked this in, someone replied that `if you don't provide a title it assumes an empty string and has to start adding suffixes so it doesn't collide with the first post you made with an empty title`.
#
[asuh]
This sort of makes sense but I’d assume that if it uses the Post ID to fill the empty title for the permalink, it wouldn’t collide. I also don’t know if post creation queries the `post_name` field in the database to make sure it doesn’t collide with anything else
#
GWG
That's why I'm confused.
#
GWG
I could try to address by generating slugs based on other info
#
[miklb]
if WP sees another post with the same title it will append `-2` but I’m not sure if that’s what’s going on with the permalink. I went with a different date based permalink & that may have coincided with the fix.
#
[asuh]
miklb I’m guessing the date based permalink was the fix, that sounds like it would fix it. But I’m not sure how I would do that for mine
#
[asuh]
I have my permalink structure setup to be just the `/%postname%/`
#
[miklb]
I still use the post ID for notes w/date. The nice thing about WP and that it will rewrite `/%postname%/` to `/2018/03/05/%postname%/` for old posts if you change your structure now.
#
[asuh]
I hear you. I used `/%postname%/` for the simplicity of the URL and to keep it being memorable to some degree. I’m wondering if I should find a way to simply add generated and arbitrary numbers as the permalink for notes
#
[miklb]
fwiw I never had any collisions with `id-2` permalink. I think I just decided I wanted notes to be date based. It would be nice to be able to have articles not include the date though.
#
[asuh]
you mean collisions that included the `-2` suffix on the ID?
#
[miklb]
yes. When I looked at the db the id without the `-2` was not associated with another post.
#
GWG
[miklb]: I don't think there is a way to have different permalink structures for different things.
#
[asuh]
darn, I was just thinking about that
#
GWG
Different post types yes. But post kinds are all the same post type
#
[miklb]
maybe with a custom post type
#
[miklb]
right, kinds are just a taxonomy on the default post type
#
GWG
I made that decision because it made the plugin more universal.
#
GWG
Requiring less custom coding
#
GWG
on the theme part at least.
tantek joined the channel
#
[asuh]
I think my use case is probably more unique than other since I’m using just the `/%postname%/`. If a permalink structure is using other tags like `/%category%/` in front of the post name, then there’s no need for the `-2` suffix.
#
[asuh]
well, replace “there’s no need” for “it just doesn’t add the suffix”
#
[asuh]
So I think I either have to generate a random number for each of these blank title posts or I’d have to change my permalink structure, which I don’t really want to do.
#
[asuh]
Maybe there could be a setting in the Post Kinds plugin that targets posts with no title to append a random string of numbers after the post ID so that it doesn’t force the ‘-2’, `-3`, etc. suffix?
tantek and [cleverdevil] joined the channel
#
GWG
[asuh]: I would possibly try something.
[eddie], tantek, [cleverdevil] and [pfefferle] joined the channel
#
[pfefferle]
[chrisaldrich] the comments are not deleted directly, they are moved to the trash folder, so you still can decide to deactivate them. Is this enough or should I also add a setting to enable/disable the feature?
#
[pfefferle]
s/deactivate/reactivate
[chrisaldrich] joined the channel
#
[chrisaldrich]
That's probably fine too though it requires keeping an eye on them to make sure they don't get auto deleted.
#
[chrisaldrich]
I think wp does a chron delete after 30 days?
#
[pfefferle]
Also the trashed comments? I thought only the spam comments...
#
[pfefferle]
Perhaps I add setttings and/or an email notification
#
[pfefferle]
I thought it would be nice to have the delete feature with the coming GDPR in mind...
#
[chrisaldrich]
It's been a while since I looked but I think it does that with both spam and trash.
#
[pfefferle]
Ok, will verify that... thanks for the feedback
#
GWG
[pfefferle], maybe as an alternative to delete we add a feature to mark the comment as deleted somehow. Have to think on how that looks.
#
[pfefferle]
But the comment is not deleted... only trashed
#
[pfefferle]
Isn‘t that the same as „marked as deleted“?
#
tantek
[pfefferle]: you may want to keep the comment and just display it with a strikethrough style
#
[pfefferle]
That is a point
#
[pfefferle]
But that makes it more complex because this makes only sense for replys... strikethrough a facepiled like, makes no sense
#
[pfefferle]
Will think about that
#
tantek
[pfefferle]: agreed
#
tantek
responses like like, repost, perhaps even reacji can probably just be deleted
#
[pfefferle]
reactji is not really a comment-type in the current state, so this might be difficult too
[kevinmarks], alx, [tantek], [alexander], [eddie], dougbeal|mb1, [jeremycherfas], [cleverdevil], [miklb], chrisaldrich, tantek and skippy joined the channel
#
skippy
anyone know what, in WordPress, is adding this junk?
#
skippy
<link rel='dns-prefetch' href='//s.w.org' />
#
skippy
<script type="text/javascript">
#
skippy
window._wpemojiSettings =
#
skippy
and can i easily turn off the generated rel=alterate links?
[eddie] joined the channel; skippy left the channel
#
GWG
I am off work for the night if you still have questions
#
GWG
I believe WordPress itself does that
[miklb] joined the channel
#
[miklb]
skippy, that’s the bullshit faux emoji stuff that WP inserts I use this plugin to remove all of that https://github.com/jeseph/disable-emoji-support
#
Loqi
[jeseph] disable-emoji-support: Improve WordPress performance by disabling core Emoji Support
#
[miklb]
it was probably a good idea before browsers fully supported emoji, but now it is just more cruft IMVHO
tantek joined the channel
#
[miklb]
that is in my mu-plugins directory
[cleverdevil] and [kevinmarks] joined the channel