MyBB Community Forums

Full Version: SEO friendly Attachment URL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, 
I have a couple of questions related to SEO and settings. 

#1  Is it possible to create a SEO friendly attachment URL?

For example, if you see here , the attachment URL is in the form 
/forums/attachment.php?aid=1440

I would like to change it to more SEO friendly URL like 

/forums/factory-default.png

I am already using the excellent SEO plugin by Andreas Klauer It seems to have SEO setting for everything except perhaps attachments. I am on the latest stable version of myBB 1.8.15

Can this be done?

#2 Do not show "Send email to user" text to non-logged in members 

As of now this text is shown on every user profile page to non-logged in member Check this profile page for example. https://www.learnqtp.com/forums/User-Anusha-bandari

I would want that "Send email to user" text should not be shown to non-logged in members.

Thanks!
#2] Guests cannot send emails & PMs to the members.
Guests get error message when they attempt to mail / PM a member.

yet if you do not want to show those profile links to guests then :
you may install & use template conditionals plugin & add required
conditional codes in member_profile template

with the plugin installed & activated,
find {$contact_details} in member_profile template of the theme & change like below
<if $mybb->users['uid'] <> 0 then>
{$contact_details}
</if>

however, I'd prefer to NOT show member profiles to guest users.
Guests group settings at forum admin panel has related option

forum admin panel >> Users & Groups >> Guests >> Forums and Posts (tab)
>> Viewing Options >> Can view user profiles? --> un-select check box
& save user group settings
Thanks for your help with #2.

Please let me know if you have any inputs on #1.
The way MyBB builds the attachment links (which sometimes aren't links, but outright embedded images) is very different from how it handles forum/thread/profile/etc. links.

MyBB's built-in URL feature doesn't cover attachments either. It turns showthread.php?tid=123 into thread-123.html, but won't change attachment.php?aid=123 to attachment-123.html or anything like it.

Google SEO doesn't cover attachments... it wasn't a priority and the way MyBB builds the attachment links is very different from forum/thread/profile/etc. links.

There is also a bit of controversy regarding attachments in Google. Most admins would want you to visit your forum, not just download your attachments directly. A lot of forums don't actually make their attachments visible to guests for similar reasons.

It's still possible to do but I don't know any existing solution for it, so you'd have to put in some effort by yourself. Especially if you want to do it properly and not some half-hearted solution.

Perhaps wait for MyBB 1.9 since it changes its template system, which might also affect attachment handling as that is - kind of - done via templates currently.

postbit_attachments_attachment
<a href="attachment.php?aid={$attachment['aid']}" target="_blank" title="{$attachdate}">{$attachment['filename']}</a>

The template hardcodes the attachment.php?aid=X style.

Well, if you want a poor man's SEO in there, you could finagle the attachment filename into it.

<a href="attachment.php?aid={$attachment['aid']}#{$attachment['filename']}" ...

Not sure what happens if someone puts " in their attachment name though.

Well, it might work. Good luck.
Thanks for your inputs @frostschutz You have been a tremendous help for past several years for all thing myBB.

The problem with 1.8.x series and earlier is that the "image" button on the editor asks you to insert an image using a URL and doesn't provide you an option to upload the image. So my forum members use a workaround and use Attachments as a substitute for showing images on a given forum post.

Yes, if my members were uploading zip files etc for attachments I would never have allowed this feature to be used by non-logged in members but most of my users use it for image uploading and I believe images should be visible to all members including search bots for better SEO visibility.

In short, image button should behave the way it works in WordPress and all other CMS systems. If not, there should be a better way to handle attachments.